question

jack-ccc10 avatar image
jack-ccc10 asked

java.lang.NoClassDefFoundError: com.amazon.device.messaging.ADM

HI, I am Making Application for Amazon Kindle fire device, I used information at given here. https://developer.amazon.com/sdk/adm.html. I also added amazon-device-messaging-1.0.1.jar as per guide line. and I tried to run in emulator(I create emulation as per information at https://developer.amazon.com/sdk/fire/emulator-guide.html) I got following Error and App crashed. 06-05 14:39:11.154: E/AndroidRuntime(1015): FATAL EXCEPTION: main 06-05 14:39:11.154: E/AndroidRuntime(1015): java.lang.NoClassDefFoundError: com.amazon.device.messaging.ADM 06-05 14:39:11.154: E/AndroidRuntime(1015): at com.example.admdemo.MainActivity.onCreate(MainActivity.java:16) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.Activity.performCreate(Activity.java:4635) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2026) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2087) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.ActivityThread.access$600(ActivityThread.java:126) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1167) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.os.Handler.dispatchMessage(Handler.java:99) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.os.Looper.loop(Looper.java:137) 06-05 14:39:11.154: E/AndroidRuntime(1015): at android.app.ActivityThread.main(ActivityThread.java:4560) 06-05 14:39:11.154: E/AndroidRuntime(1015): at java.lang.reflect.Method.invokeNative(Native Method) 06-05 14:39:11.154: E/AndroidRuntime(1015): at java.lang.reflect.Method.invoke(Method.java:511) 06-05 14:39:11.154: E/AndroidRuntime(1015): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-05 14:39:11.154: E/AndroidRuntime(1015): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-05 14:39:11.154: E/AndroidRuntime(1015): at dalvik.system.NativeStart.main(Native Method) 06-05 14:40:42.144: E/AndroidRuntime(1015): Handle UnCaght exceptions. KILLING PID: 1015 Please Help me to find out solution for this, Thanks!
fire tablet
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Jack, Thank you for your post. I think you are running the project on Kindle 1st Gen Emulator. I mean your target emulator might have below configuration set, Device : Kindle Fire (1st Generation) (600 x 1024: mdpi) Target : Kindle Fire (Amazon) - API Level 10 ADM is not supported in Kindle Fire 1st Generation. Please create an emulator of type either Kindle Fire HD 8.9" 4G or Kindle Fire HD 8.9" or Kindle Fire HD 7" to test your ADM implementation. Please refer below link, https://developer.amazon.com/sdk/adm/faq.html#gettingstarted
10 |5000

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

jack-ccc10 avatar image
jack-ccc10 answered
Thanks for Response. But issue not solved. I tried in Kindle Fire 2nd Generation and Kindle Fire HD 8.9 in Both I got Same Error as Before. Please advise me.
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Jack, I am sure that you are not configuring your Kindle emulator correctly. If the emulator is correctly configured, the ADM library classes should be found in run time other than Kindle Fire 1st Gen emulator. Please read the below post of mine to understand how to to configure the emulator, https://forums.developer.amazon.com/forums/thread.jspa?messageID=3284 Make sure to select Device and Target correctly for Kindle emulators. e.g. for 2nd gen the Device and Target should be following Device: Kindle Fire (2nd Generation) (600 x 1024: mdpi) Target Kindle Fire (2nd Generation) (Amazon) - API Level 15
10 |5000

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

jack-ccc10 avatar image
jack-ccc10 answered
Thanks Sujoy! I have configured all emulator currently, I think there is no problem with emulator as I run in Device also and found same error. please can you tell me, is there any problem in my code or jar integration?
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
Hi Jack, If the device/emulator supports ADM, this message is almost always caused by not having the amazon:enable-feature tag in the manifest, or not having it in the correct place (inside the application tag). There is a sample manifest in the docs here: https://developer.amazon.com/sdk/adm/integrating-app.html Also check: and
10 |5000

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

fkoa avatar image
fkoa answered
- I signed my app - Got an API_key - Compiled with "amazon-device-messaging-1.0.1.jar" and didn't include it to the APK - Added everything in my manifest - Double checked that "amazon:enable-feature android:name="com.amazon.device.messaging" was inside the "application" tag - I tried on a real 3rd gen Kindle Fire HDX running FireOS 4.5.4 And i still have the NoClassDefFoundError. Did I miss someting (or a dozen of things) to make this awfully complex system working ?
10 |5000

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

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for getting in touch. I'm not sure why you're getting this issue, but is there any reason why you didn't include the .jar in your apk? Perhaps this is related to the problem. Regards, Jamie
10 |5000

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

Frimus Technologies avatar image
Frimus Technologies answered

Hi fkoa,

Were you able to solve the problem ? I'm also getting same crash of java.lang.NoClassDefFoundError: com.amazon.device.messaging.ADM on Kindle Fire HDX 3rd Gen.

Any help would be highly appreciated.

Thanks,

Enna

10 |5000

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