0

我在我的应用程序中发现 ClassNotFoundException,但该类已存在.. 这是项目工作区

我正在使用很多库,但是在创建构建路径和依赖项时遇到问题..

Logcat 显示消息:

12-10 00:36:56.840: W/System.err(12666): java.lang.ClassNotFoundException: Could not find class: org.holoeverywhere.internal.AlertController.RecycleListView
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:318)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:325)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.LayoutInflater$HoloFactoryMerger.onCreateView(LayoutInflater.java:63)
12-10 00:36:56.845: W/System.err(12666):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:660)
12-10 00:36:56.845: W/System.err(12666):    at android.view.LayoutInflater.inflate(LayoutInflater.java:457)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:278)
12-10 00:36:56.845: W/System.err(12666):    at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:263)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:258)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.internal.AlertController$AlertParams.createListView(AlertController.java:144)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.internal.AlertController$AlertParams.apply(AlertController.java:130)
12-10 00:36:56.845: W/System.err(12666):    at org.holoeverywhere.app.AlertDialog$Builder.create(AlertDialog.java:41)
12-10 00:36:56.845: W/System.err(12666):    at org.isolaa.droidquiz.DashboardActivity$QuizFragment.onItemLongClick(DashboardActivity.java:455)
12-10 00:36:56.850: W/System.err(12666):    at android.widget.AbsListView.performLongPress(AbsListView.java:2703)
12-10 00:36:56.850: W/System.err(12666):    at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:2651)
12-10 00:36:56.850: W/System.err(12666):    at android.os.Handler.handleCallback(Handler.java:587)
12-10 00:36:56.850: W/System.err(12666):    at android.os.Handler.dispatchMessage(Handler.java:92)
12-10 00:36:56.850: W/System.err(12666):    at android.os.Looper.loop(Looper.java:132)
12-10 00:36:56.850: W/System.err(12666):    at android.app.ActivityThread.main(ActivityThread.java:4123)
12-10 00:36:56.850: W/System.err(12666):    at java.lang.reflect.Method.invokeNative(Native Method)
12-10 00:36:56.850: W/System.err(12666):    at java.lang.reflect.Method.invoke(Method.java:491)
12-10 00:36:56.850: W/System.err(12666):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
12-10 00:36:56.855: W/System.err(12666):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
12-10 00:36:56.855: W/System.err(12666):    at dalvik.system.NativeStart.main(Native Method)
12-10 00:36:56.855: W/System.err(12666): android.view.InflateException: Binary XML file line #2: Error inflating class org.holoeverywhere.internal.AlertController.RecycleListView
12-10 00:36:56.855: W/System.err(12666):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
12-10 00:36:56.855: W/System.err(12666):    at android.view.LayoutInflater.inflate(LayoutInflater.java:457)
12-10 00:36:56.855: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:278)
12-10 00:36:56.855: W/System.err(12666):    at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
12-10 00:36:56.855: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:263)
12-10 00:36:56.855: W/System.err(12666):    at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:258)
12-10 00:36:56.855: W/System.err(12666):    at org.holoeverywhere.internal.AlertController$AlertParams.createListView(AlertController.java:144)
12-10 00:36:56.860: W/System.err(12666):    at org.holoeverywhere.internal.AlertController$AlertParams.apply(AlertController.java:130)
12-10 00:36:56.860: W/System.err(12666):    at org.holoeverywhere.app.AlertDialog$Builder.create(AlertDialog.java:41)
12-10 00:36:56.860: W/System.err(12666):    at org.isolaa.droidquiz.DashboardActivity$QuizFragment.onItemLongClick(DashboardActivity.java:455)
12-10 00:36:56.860: W/System.err(12666):    at android.widget.AbsListView.performLongPress(AbsListView.java:2703)
12-10 00:36:56.860: W/System.err(12666):    at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:2651)
12-10 00:36:56.860: W/System.err(12666):    at android.os.Handler.handleCallback(Handler.java:587)
12-10 00:36:56.860: W/System.err(12666):    at android.os.Handler.dispatchMessage(Handler.java:92)
12-10 00:36:56.860: W/System.err(12666):    at android.os.Looper.loop(Looper.java:132)
12-10 00:36:56.860: W/System.err(12666):    at android.app.ActivityThread.main(ActivityThread.java:4123)
12-10 00:36:56.860: W/System.err(12666):    at java.lang.reflect.Method.invokeNative(Native Method)
12-10 00:36:56.865: W/System.err(12666):    at java.lang.reflect.Method.invoke(Method.java:491)
12-10 00:36:56.865: W/System.err(12666):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
12-10 00:36:56.865: W/System.err(12666):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
12-10 00:36:56.865: W/System.err(12666):    at dalvik.system.NativeStart.main(Native Method)
12-10 00:36:56.865: W/System.err(12666): Caused by: java.lang.ClassNotFoundException: org.holoeverywhere.internal.AlertController.RecycleListView in loader dalvik.system.PathClassLoader[/data/app/org.isolaa.droidquiz-1.apk]
12-10 00:36:56.870: W/System.err(12666):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
12-10 00:36:56.870: W/System.err(12666):    at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
12-10 00:36:56.870: W/System.err(12666):    at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
12-10 00:36:56.870: W/System.err(12666):    at android.view.LayoutInflater.createView(LayoutInflater.java:542)
12-10 00:36:56.870: W/System.err(12666):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:671)
12-10 00:36:56.870: W/System.err(12666):    ... 20 more
4

1 回答 1

0

如果您使用的是 eclipse,请确保它们已在构建路径中配置。这样它就包含在 APK 中。此外,由于 ADB 传输文件的方式,您的 DroidQuiz.apk 会变成 DroidQuiz-1.apk。不管你叫什么apk,它都会做同样的事情。

于 2013-06-27T20:04:34.163 回答