3

I have made my first android app. It works fine locally. But when I upload it to the market, somehow people have problems with it. I cannot figure out what went wrong. Even when I have the stack trace:

java.lang.RuntimeException: Unable to instantiate application com.jphellemons.koopzondag.Koopzondag: java.lang.ClassNotFoundException: com.jphellemons.koopzondag.Koopzondag in loader dalvik.system.PathClassLoader[/data/app/com.jphellemons.koopzondag-2.apk]
at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:715)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4615)
at android.app.ActivityThread.access$3000(ActivityThread.java:136)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2223)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:5068)
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:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.jphellemons.koopzondag.Koopzondag in loader dalvik.system.PathClassLoader[/data/app/com.jphellemons.koopzondag-2.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.newApplication(Instrumentation.java:945)
at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:706)

Please let me know if i have to show the manifest and/or source code? I really have no idea I will update this thread if I have the answer!

I have read about this issue here: java.lang.ClassNotFoundException on working app

So I guess that my fault is a setting in this window: can someone help me out with that?

enter image description here

Edit: I changed the first class from helloandroid.java to koopzondag.java and now i have the classcastexception. so I renamed the complete project. but now it can't launch the resource?

edit2 : Looks like this is the issue: but how do I resolve it? http://androidforums.com/application-development/216707-classcastexception-starting-activity.html#post1905263

Community
  • 1
  • 1
JP Hellemons
  • 5,977
  • 11
  • 63
  • 128
  • What export settings did you use to create the .apk? – gatnowurry Jan 24 '11 at 10:57
  • @gatnowurry: I used the default export from eclipse 'Export Android Application' where can I view export settings? – JP Hellemons Jan 24 '11 at 11:12
  • possible duplicate of [android classcastexception on activity startup](http://stackoverflow.com/questions/3838640/android-classcastexception-on-activity-startup) – jrockway Feb 17 '12 at 19:27

3 Answers3

1

If you are using additional jars, you need to add those to the /libs folder.

Macarse
  • 91,829
  • 44
  • 175
  • 230
0

If you are using Android API Level higher than the phones are supporting, you'll get Runtime exceptions.

You seem to use API Level 8, have you specified the right levels in the manifest file?

Phyrum Tea
  • 2,623
  • 1
  • 19
  • 20
0

the answer: android classcastexception on activity startup

Quote from Maxim:

  1. Open AndroidManifest.xml

  2. Find tag application

  3. Remove attribute android:name (if exists)

  4. Add attribute android:name="android.app.Application"

Community
  • 1
  • 1
JP Hellemons
  • 5,977
  • 11
  • 63
  • 128