Larphoid
Larphoid

Reputation: 1005

ClassNotFoundException when downloaded from Google Play

I've got a problem involving ClassNotFoundException. When i "Run as android application" from eclipse it works fine, but when i download it from Google Play (same source code but "Exported as signed app") it crashes with the following stacktrace:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.larphoid.aeboing/com.larphoid.aeboing.BoingBoing}: java.lang.ClassNotFoundException: com.larphoid.aeboing.BoingBoing in loader dalvik.system.PathClassLoader[/data/app/com.larphoid.aeboing-1.apk]     
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2703)   
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2797)    
    at android.app.ActivityThread.access$2300(ActivityThread.java:135)  
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2132)     
    at android.os.Handler.dispatchMessage(Handler.java:99)  
    at android.os.Looper.loop(Looper.java:143)  
    at android.app.ActivityThread.main(ActivityThread.java:4914)    
    at java.lang.reflect.Method.invokeNative(Native Method)     
    at java.lang.reflect.Method.invoke(Method.java:521)     
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)  
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)     
    at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.ClassNotFoundException: com.larphoid.aeboing.BoingBoing in loader dalvik.system.PathClassLoader[/data/app/com.larphoid.aeboing-1.apk]     
    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)    
    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)    
    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)    
    at android.app.Instrumentation.newActivity(Instrumentation.java:1033)   
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695)   
... 11 more

I've never had this problem before, and i'm not experienced yet in "reading" Stacktraces, so i'm pretty much puzzled at this. If anyone has some pointers or solution i'd appreciate it.

Thanks.

Upvotes: 1

Views: 849

Answers (3)

Sander van't Veer
Sander van't Veer

Reputation: 5980

Gonna copy this from another question as I had the exact same problem before, and this is how I fixed it:

If you're running adt rev 22, you might not be exporting your libraries. I don't know why Google did this exactly, but in the newest revolution you have to check to make sure you're exporting your libraries yourself.

Right click your project, click Properties, and check Order & Export under Java Build Path. It should look like this if you want to export everything:

enter image description here Afterwards, rebuild the application and export it again. It should be working now. To test, simply install the .apk to your phone manually before putting it on the store to make sure it works.

Upvotes: 4

No_Rulz
No_Rulz

Reputation: 2719

Maybe you change your package name while signing your apk. Check your package and class name

Upvotes: 0

sschrass
sschrass

Reputation: 7166

ClassNotFoundException indicates that something is missing on the classpath. Maybe you are missing a library in the classpath.

As the name suggests classNotFoundException in Java is a subclass of java.lang.Exception and Comes when Java Virtual Machine tries to load a particular class and doesn't found the requested class in classpath.

Upvotes: 1

Related Questions