简体   繁体   中英

ClassNotFoundException when running an android app

I'm trying to run the Spydroid app from . But run into a "Unfortunately Spydroid has stopped" as soon as it runs on my Nexus 4.

I used egit to grab a copy of the code into a new project in eclipse. At that point, it threw out a couple errors telling me to right click on the project and select Android Tools --> Fix Project Properties. I did as it said and then hit run, which uploads it to the Nexus 4, installs it and when it attempts to run is when I get the crash.

Am I doing something wrong in the checkout/setup process? I posted a similar post to the project's google code page

Logcat:

03-28 02:59:20.028: D/AndroidRuntime(31294): Shutting down VM
03-28 02:59:20.028: W/dalvikvm(31294): threadid=1: thread exiting with uncaught exception (group=0x41920930)
03-28 02:59:20.028: E/AndroidRuntime(31294): FATAL EXCEPTION: main
03-28 02:59:20.028: E/AndroidRuntime(31294): java.lang.RuntimeException: Unable to instantiate application net.majorkernelpanic.spydroid.SpydroidApplication: java.lang.ClassNotFoundException: Didn't find class "net.majorkernelpanic.spydroid.SpydroidApplication" on path: /data/app/net.majorkernelpanic.spydroid-1.apk
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.ActivityThread.access$1300(ActivityThread.java:141)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.os.Looper.loop(Looper.java:137)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.ActivityThread.main(ActivityThread.java:5041)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at java.lang.reflect.Method.invokeNative(Native Method)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at java.lang.reflect.Method.invoke(Method.java:511)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at dalvik.system.NativeStart.main(Native Method)
03-28 02:59:20.028: E/AndroidRuntime(31294): Caused by: java.lang.ClassNotFoundException: Didn't find class "net.majorkernelpanic.spydroid.SpydroidApplication" on path: /data/app/net.majorkernelpanic.spydroid-1.apk
03-28 02:59:20.028: E/AndroidRuntime(31294):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.Instrumentation.newApplication(Instrumentation.java:968)
03-28 02:59:20.028: E/AndroidRuntime(31294):    at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
03-28 02:59:20.028: E/AndroidRuntime(31294):    ... 11 more

Possible error can be:

  • Check the package name carefully
  • Check order/export option in Build Path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM