启动我的应用程序时出现ClassNotFoundException错误,提供了logcat

时间:2013-05-28 13:01:53

标签: java android logcat

一旦我加载应用程序,它立即崩溃我的模拟器。它以前从来没有用过这个,我最近对我的Android SDK Manager for 4.2.2进行了更新,但我不认为这可能是问题,但我只是不知道。

我的项目保存在我的C:\ Users \ Joey \ development \ LibrarySmite11

每当我在我的模拟器上加载我的应用程序时,我收到此消息:

05-28 12:27:19.364: W/dalvikvm(6397): Unable to resolve superclass of Ljoseph/lubonty/librarysmite11/Splash; (37)
05-28 12:27:19.364: W/dalvikvm(6397): Link of class 'Ljoseph/lubonty/librarysmite11/Splash;' failed
05-28 12:27:19.364: D/AndroidRuntime(6397): Shutting down VM
05-28 12:27:19.364: W/dalvikvm(6397): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
05-28 12:27:19.384: E/AndroidRuntime(6397): FATAL EXCEPTION: main
05-28 12:27:19.384: E/AndroidRuntime(6397): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{joseph.lubonty.librarysmite11/joseph.lubonty.librarysmite11.Splash}: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.ActivityThread.access$600(ActivityThread.java:122)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.os.Looper.loop(Looper.java:137)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.ActivityThread.main(ActivityThread.java:4340)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at java.lang.reflect.Method.invokeNative(Native Method)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at java.lang.reflect.Method.invoke(Method.java:511)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at dalvik.system.NativeStart.main(Native Method)
05-28 12:27:19.384: E/AndroidRuntime(6397): Caused by: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash
05-28 12:27:19.384: E/AndroidRuntime(6397):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-28 12:27:19.384: E/AndroidRuntime(6397):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870)
05-28 12:27:19.384: E/AndroidRuntime(6397):     ... 11 more

当我看到这些消息时,我想知道为什么在警告中“约瑟夫”面前有一个“L”,我不确定这是否可能是问题,但这只是一个想法。

在LogCat中引起我注意的另外两件事:

其中一个就是:

05-28 12:27:19.384: E/AndroidRuntime(6397): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{joseph.lubonty.librarysmite11/joseph.lubonty.librarysmite11.Splash}: 

为什么我会看到:

ComponentInfo{joseph.lubonty.librarysmite11/joseph.lubonty.librarysmite11.Splash}

应该是:

ComponentInfo{joseph.lubonty.librarysmite11.Splash}


另一种是当我在LogCat上查看这些行时:

05-28 12:27:19.384: E/AndroidRuntime(6397): Caused by: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash
05-28 12:27:19.384: E/AndroidRuntime(6397):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)

我觉得这两条线是我需要检查的地方,但老实说我真是惊讶于这是什么意思。我实际上是在我的项目中盯着我的Splash类,它说它无法找到。任何人都有任何想法为什么会这样?

1 个答案:

答案 0 :(得分:2)

更新android工具和私有库时,请在更新android 4.2时取消选中,因此请尝试检查它们,清理并构建项目。请查看此问题以供参考Libraries do not get added to APK anymore after upgrade to ADT 22