无法解析静态字段1868

时间:2014-12-15 03:22:35

标签: android

当我调试我的代码时,它会遇到此错误。它是什么?以及如何解决?

12-15 11:13:45.179: W/dalvikvm(2545): VFY: unable to resolve static field 1868 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;

12-15 11:13:45.179: D/dalvikvm(2545): VFY: replacing opcode 0x62 at 0x0004

12-15 11:13:45.189: D/AndroidRuntime(2545): Shutting down VM

12-15 11:13:45.189: W/dalvikvm(2545): threadid=1: thread exiting with uncaught exception (group=0x430f9140)

12-15 11:13:45.189: E/AndroidRuntime(2545): FATAL EXCEPTION: main

12-15 11:13:45.189: E/AndroidRuntime(2545): Process: info.androidhive.androidcameraapi, PID: 2545

12-15 11:13:45.189: E/AndroidRuntime(2545): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:106)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:99)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at info.androidhive.androidcameraapi.Result.onCreate(Result.java:28)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.Activity.performCreate(Activity.java:5411)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.ActivityThread.access$800(ActivityThread.java:139)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.os.Handler.dispatchMessage(Handler.java:102)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.os.Looper.loop(Looper.java:149)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at android.app.ActivityThread.main(ActivityThread.java:5268)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at java.lang.reflect.Method.invokeNative(Native Method)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at java.lang.reflect.Method.invoke(Method.java:515)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)

12-15 11:13:45.189: E/AndroidRuntime(2545):     at dalvik.system.NativeStart.main(Native Method)

12-15 11:13:50.169: I/Process(2545): Sending signal. PID: 2545 SIG: 9

1 个答案:

答案 0 :(得分:2)

您的错误是:

12-15 11:13:45.189: E/AndroidRuntime(2545): FATAL EXCEPTION: main

12-15 11:13:45.189: E/AndroidRuntime(2545): Process: info.androidhive.androidcameraapi, PID: 2545

12-15 11:13:45.189: E/AndroidRuntime(2545): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable

您需要将支持库添加到项目的libs文件夹中。查看官方文档:https://developer.android.com/tools/support-library/setup.html#add-library