gpt4 book ai didi

java - NoClassDefFoundError ,这里忽略了什么? (附图)

转载 作者:太空狗 更新时间:2023-10-29 16:07:25 27 4
gpt4 key购买 nike

症状:我正在使用从创建者的 git 存储库中提取的项目。我包含了它们的库,如 libs 文件夹中所示。项目没有错误,项目编译。然而,当它访问一个应该在 jar 中的对象时,它崩溃了。

我已经完成了我在此处阅读的其他一些建议。我读过一些关于更改 classpath 的内容,它在哪里?

此外,jar 的 src 代码显示所讨论的对象实际存在....

ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();

05-30 11:26:16.878: E/AndroidRuntime(11098): FATAL EXCEPTION: main
05-30 11:26:16.878: E/AndroidRuntime(11098): java.lang.NoClassDefFoundError: twitter4j.conf.ConfigurationBuilder
05-30 11:26:16.878: E/AndroidRuntime(11098): at com.pigmal.android.ex.twitter4j.TwitterApp.askOAuth(TwitterApp.java:110)
05-30 11:26:16.878: E/AndroidRuntime(11098): at com.pigmal.android.ex.twitter4j.TwitterApp.onClick(TwitterApp.java:144)
05-30 11:26:16.878: E/AndroidRuntime(11098): at android.view.View.performClick(View.java:2482)
05-30 11:26:16.878: E/AndroidRuntime(11098): at android.view.View$PerformClick.run(View.java:9077)
05-30 11:26:16.878: E/AndroidRuntime(11098): at android.os.Handler.handleCallback(Handler.java:587)
05-30 11:26:16.878: E/AndroidRuntime(11098): at a ndroid.os.Handler.dispatchMessage(Handler.java:92)
05-30 11:26:16.878: E/AndroidRuntime(11098): at android.os.Looper.loop(Looper.java:130)
05-30 11:26:16.878: E/AndroidRuntime(11098): at android.app.ActivityThread.main(ActivityThread.java:3683)
05-30 11:26:16.878: E/AndroidRuntime(11098): at java.lang.reflect.Method.invokeNative(Native Method)
05-30 11:26:16.878: E/AndroidRuntime(11098): at java.lang.reflect.Method.invoke(Method.java:507)
05-30 11:26:16.878: E/AndroidRuntime(11098): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-30 11:26:16.878: E/AndroidRuntime(11098): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-30 11:26:16.878: E/AndroidRuntime(11098): at dalvik.system.NativeStart.main(Native Method)

这是我完整的项目设置。这是使用 Android 的事实在这里可能不相关,我不想通过将其标记为 Android 来疏远 Java 专家

最佳答案

这为我解决了 http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17

What I did to fix the bug was :

Remove the libraries from the standard Java build path :
Right click on the project name > Properties > Java Build Path > tab Libraries > remove everything except the “Android X.X” (2.3.3 in my case) and the “Android Dependencies”
Rename the libraries folder from “lib” to “libs”
By doing that, all the libraries in the folder “libs” are found by the Android plugin and are added to the “Android Dependencies” item of the project
Restart Eclipse
Android Dependencies should be created. Running the app won't produce NoClassDefFoundError anymore

异常(exception)情况是我必须在按照这些说明进行操作后重新启动 ECLIPSE,而不仅仅是事后清理项目。

关于java - NoClassDefFoundError ,这里忽略了什么? (附图),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10820295/

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