异常java.lang.NoClassDefFoundError的:android.support.v7.appcompat.R $设置样式样式、异常、lang、java

2023-09-06 09:27:25 作者:你若是梦我永远都不愿醒来

大家好,我得到一个例外,同时与支持LIB工作。我知道很多的问题和答案都可以在左右,但对我来说没有任何一部作品

Hi all I am getting a exception while working with support lib. I know lot of question and answer are available in SO but no one work for me

11-27 11:58:15.470: E/AndroidRuntime(19609): FATAL EXCEPTION: main
11-27 11:58:15.470: E/AndroidRuntime(19609): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:147)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:138)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at com.devicemonitor.DeviceMonitorActivity.onCreate(DeviceMonitorActivity.java:29)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.Activity.performCreate(Activity.java:5104)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.os.Looper.loop(Looper.java:137)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at android.app.ActivityThread.main(ActivityThread.java:5041)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at java.lang.reflect.Method.invokeNative(Native Method)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at java.lang.reflect.Method.invoke(Method.java:511)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
11-27 11:58:15.470: E/AndroidRuntime(19609):    at dalvik.system.NativeStart.main(Native Method)

我已经做了是这样的 - 我有Android系统的支持-V7-appcompat.jar以及Android的支持,v4.jar Android中Java构建路径

What i have did is like this - I have android-support-v7-appcompat.jar as well as android-support-v4.jar in android java build path.

在SO一些答案建议,在Java构建路径选中的Andr​​oid依赖我想它也,但没有为我工作。

In some answer in SO suggested that unchecked Android dependencies in java build path i tried it also but nothing is working for me.

在我的根文件夹中有两个包一个用于古尔播放服务-lib和另一个用于我的项目,并在根文件夹我的项目包只trwo文件是有R.java和BuildCOnfig.java。任何人有任何建议,请给我建议

In my gen folder there are two package one for goole-play-service-lib and another for my project , and in my project package under gen folder only trwo file is there R.java and BuildCOnfig.java. Anybody have any suggestion please suggest me

推荐答案

导入support.v7.appcompat作为工作空间中的库项目,并与您的项目连接了。

Import the support.v7.appcompat as a library project in your workspace and attach it with your project.

试试这个,它的工作是肯定的。 如果你仍然面临的任何问题,请评论。

Try this,it will work for sure. if you still face any issue, do comment.