gpt4 book ai didi

java - Eclipse Android java.lang.NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-01 06:15:37 28 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





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

(1 个回答)



ActionBarWindow "Unable to resolve static field" [closed]

(2 个回答)


7年前关闭。




我正在尝试在 Android 开发者网站 (here) 上做 Android 教程。我在站点上安装了 Eclpise/Android SDK 包,但是当我尝试运行自动生成的代码时,它应该只显示“Hello World”,我得到一个 java.lang.NoClassDefFoundError。我自己还没有编写任何代码。

这是错误的logcat日志:

09-02 17:44:15.430: D/dalvikvm(872): Not late-enabling CheckJNI (already on)
09-02 17:44:15.780: W/dalvikvm(872): VFY: unable to resolve static field 1864 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
09-02 17:44:15.780: D/dalvikvm(872): VFY: replacing opcode 0x62 at 0x0004
09-02 17:44:15.790: D/AndroidRuntime(872): Shutting down VM
09-02 17:44:15.790: W/dalvikvm(872): threadid=1: thread exiting with uncaught exception (group=0xb2a99d70)
09-02 17:44:15.800: E/AndroidRuntime(872): FATAL EXCEPTION: main
09-02 17:44:15.800: E/AndroidRuntime(872): Process: com.example.test1, PID: 872
09-02 17:44:15.800: E/AndroidRuntime(872): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
09-02 17:44:15.800: E/AndroidRuntime(872): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:106)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:99)
09-02 17:44:15.800: E/AndroidRuntime(872): at com.example.test1.MainActivity.onCreate(MainActivity.java:13)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.Activity.performCreate(Activity.java:5242)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.ActivityThread.access$800(ActivityThread.java:138)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.os.Handler.dispatchMessage(Handler.java:102)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.os.Looper.loop(Looper.java:136)
09-02 17:44:15.800: E/AndroidRuntime(872): at android.app.ActivityThread.main(ActivityThread.java:5026)
09-02 17:44:15.800: E/AndroidRuntime(872): at java.lang.reflect.Method.invokeNative(Native Method)
09-02 17:44:15.800: E/AndroidRuntime(872): at java.lang.reflect.Method.invoke(Method.java:515)
09-02 17:44:15.800: E/AndroidRuntime(872): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
09-02 17:44:15.800: E/AndroidRuntime(872): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
09-02 17:44:15.800: E/AndroidRuntime(872): at dalvik.system.NativeStart.main(Native Method)

这是我的第一个问题,所以请让我知道是否还有其他我应该包括的内容。

最佳答案

当您的代码依赖于一个类文件并且它在编译时存在但在运行时找不到时会导致这种情况。寻找构建时间和运行时类路径的差异。

while u r running ur code android.support.v7.appcompat.R$styleable class is missing. find the jar which contain this class... add to class path then run.



访问 Why am I getting a NoClassDefFoundError in Java?

关于java - Eclipse Android java.lang.NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25630361/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com