java.lang.NoClassDefFoundError:android.support.v7.appcompat.R $ styleable

时间:2014-03-20 08:07:16

标签: android compiler-errors android-theme

我开发了一个Android应用程序。我使用AppCompat主题,当我运行我的程序时,我有一个java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable。它的日志是:

Process: com.nomad, PID: 12866
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.telera.ui.activities.OABaseActivity.onCreate(OABaseActivity.java:47)
        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(Zygote`

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:6)

  

java.lang.NoClassDefFoundError:   android.support.v7.appcompat.R $ styleableY

您需要在Android项目中引用AppCompat。您尚未正确引用库项目。

使用资源检查Adding Support Library