问题描述
我使用的终端[不偏食。我得到了下面的异常错误,而我使用 emulator.debug
成功和INSTALLD成功。但仿真器显示的 不幸的是应用程序已停止
。然后我跑 $亚行logcat
它会显示如下。
i am using terminal [not eclipse]. i got following exception error, while i use emulator.debug
successfully and installd successfully. But emulator show Unfortunatly app has stop
. Then i run $ adb logcat
it will display following.
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107)
at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
at com.example.trintwo.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
我得到这个错误,即使我安装Android的支持库和我检查 Android的支持-V7-appcompat.jar
在安卓/支持/ V7 / appcompat / lib目录
路径究竟会做些什么来清除此错误。
I got this error, Even I installed android support library and i checked android-support-v7-appcompat.jar
in android/support/v7/appcompat/lib
path what will i do to clear this error.
推荐答案
如果您使用的是Eclipse不仅仅是V7小巧库项目导入到你的工作空间,并将其添加为一个库项目否则,如果你是从做终端比你所能做的就是把 Android的支持-V7-appcompat
库项目(您可以在 SDK \演员\机器人\ SUPPORT \找到V7 \ appcompat
)在同一目录中的项目,这行添加到您的 project.properties
文件
if you are using eclipse than just import the v7 compact library project into your work space and add it as a library to your project else if you are doing it from terminal than what you can do is put android-support-v7-appcompat
library project (which you can find in sdk\extras\android\support\v7\appcompat
)in the same directory where is your project and add this line to your project.properties
file
android.library.reference.1=../android-support-v7-appcompat
不要忘了添加两个jar文件V4,V7到您的项目也是如此。
do not forget to add both the jar files v4,v7 to your project as well.
这篇关于java.lang.NoClassDefFoundError的:android.support.v7.appcompat.R $设置样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!