question

John avatar image
John asked

NoClassDefFoundError Error while running the app

I am not exporting the jar file because it contains only the stub implementations. I believe its trying to find the class files within the app (which no longer exist, jar is not exported) and causing this issue. How do I point to the device apis ? Why don't you follow the standard way to add jar file to the libs directory making life easy. With eclipse I did the exact steps mentioned. Infact, it fails in the first step, final ADM adm = new ADM(this); With ant, I modified build.xml as told. It builds fine, fails while running the app with same error. Why will it not pick the apis from the device? BTW, I could successfully run the sample app and receive sample notification, so the device has the latest firmware version. Logs: 06-04 13:53:26.810: E/AndroidRuntime(20408): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.myapp./com.myapp.MainActivity}: java.lang.ClassNotFoundException: com.myapp.MainActivity 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1991) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.ActivityThread.access$600(ActivityThread.java:126) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1172) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.os.Handler.dispatchMessage(Handler.java:99) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.os.Looper.loop(Looper.java:137) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.ActivityThread.main(ActivityThread.java:4586) 06-04 13:53:26.810: E/AndroidRuntime(20408): at java.lang.reflect.Method.invokeNative(Native Method) 06-04 13:53:26.810: E/AndroidRuntime(20408): at java.lang.reflect.Method.invoke(Method.java:511) 06-04 13:53:26.810: E/AndroidRuntime(20408): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-04 13:53:26.810: E/AndroidRuntime(20408): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-04 13:53:26.810: E/AndroidRuntime(20408): at dalvik.system.NativeStart.main(Native Method) 06-04 13:53:26.810: E/AndroidRuntime(20408): Caused by: java.lang.ClassNotFoundException: com.myapp.tabletapp.MainActivity 06-04 13:53:26.810: E/AndroidRuntime(20408): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 06-04 13:53:26.810: E/AndroidRuntime(20408): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 06-04 13:53:26.810: E/AndroidRuntime(20408): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 06-04 13:53:26.810: E/AndroidRuntime(20408): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1982) 06-04 13:53:26.810: E/AndroidRuntime(20408): ... 11 more 06-04 13:54:08.333: E/AndroidRuntime(20408): Handle UnCaght exceptions. KILLING PID: 20408
amazon device messaging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

John avatar image
John answered
Correct logs here, 06-03 16:24:13.680: E/AndroidRuntime(11038): java.lang.NoClassDefFoundError: com.amazon.device.messaging.ADM 06-03 16:24:13.680: E/AndroidRuntime(11038): at com.myapp.MainActivity.onCreate(MainActivity.java:74) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.Activity.performCreate(Activity.java:4635) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2031) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.ActivityThread.access$600(ActivityThread.java:126) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1172) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.os.Handler.dispatchMessage(Handler.java:99) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.os.Looper.loop(Looper.java:137) 06-03 16:24:13.680: E/AndroidRuntime(11038): at android.app.ActivityThread.main(ActivityThread.java:4586) 06-03 16:24:13.680: E/AndroidRuntime(11038): at java.lang.reflect.Method.invokeNative(Native Method) 06-03 16:24:13.680: E/AndroidRuntime(11038): at java.lang.reflect.Method.invoke(Method.java:511) 06-03 16:24:13.680: E/AndroidRuntime(11038): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-03 16:24:13.680: E/AndroidRuntime(11038): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-03 16:24:13.680: E/AndroidRuntime(11038): at dalvik.system.NativeStart.main(Native Method)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
You can find more information on this at the related forum posts: https://forums.developer.amazon.com/forums/thread.jspa?threadID=1121&tstart=0
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.