question

hophuong avatar image
hophuong asked

fail to display ads

Hi all, i'm applying amazon ads sdk to my app, but i got a big issue like that 08-12 10:45:44.041: I/dalvikvm(763): Failed resolving Lcom/hophuong/testamazon/MainActivity; interface 629 'Lcom/amazon/device/ads/AdListener;' 08-12 10:45:44.041: W/dalvikvm(763): Link of class 'Lcom/hophuong/testamazon/MainActivity;' failed 08-12 10:45:44.051: D/AndroidRuntime(763): Shutting down VM 08-12 10:45:44.051: W/dalvikvm(763): threadid=1: thread exiting with uncaught exception (group=0x409961f8) 08-12 10:45:44.061: E/AndroidRuntime(763): FATAL EXCEPTION: main 08-12 10:45:44.061: E/AndroidRuntime(763): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.hophuong.testamazon/com.hophuong.testamazon.MainActivity}: java.lang.ClassNotFoundException: com.hophuong.testamazon.MainActivity 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.ActivityThread.access$600(ActivityThread.java:122) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.os.Handler.dispatchMessage(Handler.java:99) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.os.Looper.loop(Looper.java:137) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.ActivityThread.main(ActivityThread.java:4340) 08-12 10:45:44.061: E/AndroidRuntime(763): at java.lang.reflect.Method.invokeNative(Native Method) 08-12 10:45:44.061: E/AndroidRuntime(763): at java.lang.reflect.Method.invoke(Method.java:511) 08-12 10:45:44.061: E/AndroidRuntime(763): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 08-12 10:45:44.061: E/AndroidRuntime(763): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 08-12 10:45:44.061: E/AndroidRuntime(763): at dalvik.system.NativeStart.main(Native Method) 08-12 10:45:44.061: E/AndroidRuntime(763): Caused by: java.lang.ClassNotFoundException: com.hophuong.testamazon.MainActivity 08-12 10:45:44.061: E/AndroidRuntime(763): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 08-12 10:45:44.061: E/AndroidRuntime(763): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 08-12 10:45:44.061: E/AndroidRuntime(763): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 08-12 10:45:44.061: E/AndroidRuntime(763): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870) 08-12 10:45:44.061: E/AndroidRuntime(763): ... 11 more 08-12 10:45:47.371: I/Process(763): Sending signal. PID: 763 SIG: 9 08-12 10:50:41.911: I/dalvikvm(809): Failed resolving Lcom/hophuong/testamazon/MainActivity; interface 629 'Lcom/amazon/device/ads/AdListener;' 08-12 10:50:42.031: W/dalvikvm(809): Link of class 'Lcom/hophuong/testamazon/MainActivity;' failed 08-12 10:50:42.031: D/AndroidRuntime(809): Shutting down VM 08-12 10:50:42.051: W/dalvikvm(809): threadid=1: thread exiting with uncaught exception (group=0x409961f8) 08-12 10:50:42.402: E/AndroidRuntime(809): FATAL EXCEPTION: main 08-12 10:50:42.402: E/AndroidRuntime(809): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.hophuong.testamazon/com.hophuong.testamazon.MainActivity}: java.lang.ClassNotFoundException: com.hophuong.testamazon.MainActivity 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.ActivityThread.access$600(ActivityThread.java:122) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.os.Handler.dispatchMessage(Handler.java:99) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.os.Looper.loop(Looper.java:137) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.ActivityThread.main(ActivityThread.java:4340) 08-12 10:50:42.402: E/AndroidRuntime(809): at java.lang.reflect.Method.invokeNative(Native Method) 08-12 10:50:42.402: E/AndroidRuntime(809): at java.lang.reflect.Method.invoke(Method.java:511) 08-12 10:50:42.402: E/AndroidRuntime(809): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 08-12 10:50:42.402: E/AndroidRuntime(809): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 08-12 10:50:42.402: E/AndroidRuntime(809): at dalvik.system.NativeStart.main(Native Method) 08-12 10:50:42.402: E/AndroidRuntime(809): Caused by: java.lang.ClassNotFoundException: com.hophuong.testamazon.MainActivity 08-12 10:50:42.402: E/AndroidRuntime(809): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 08-12 10:50:42.402: E/AndroidRuntime(809): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 08-12 10:50:42.402: E/AndroidRuntime(809): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 08-12 10:50:42.402: E/AndroidRuntime(809): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870) 08-12 10:50:42.402: E/AndroidRuntime(809): ... 11 more 08-12 10:55:42.799: I/Process(809): Sending signal. PID: 809 SIG: 9 is this error come from amazon side or i had missed something? note: this error coming after i apply all step in https://developer.amazon.com/sdk/mobileads/quick-start.html please help!! many thank VPhuong Message was edited by: hophuong Message was edited by: hophuong
mobile ads
10 |5000 characters needed characters left characters exceeded

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

Pedro avatar image
Pedro answered
Looks like Amazon's Ads JAR is not being included in your APK. What method did you use to include the "amazon-ads-5.1.10.jar" ?
10 |5000 characters needed characters left characters exceeded

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

hophuong avatar image
hophuong answered
i'm using amazon-ads-5.1.14.jar
10 |5000 characters needed characters left characters exceeded

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

hophuong avatar image
hophuong answered
the same issue with the sample in the Apps-SDK which downloaded from amazon developer page. so confuse @pedro Click on project Properties Select "Java Build Path" Select Libraries on the top Click "Add External JARs..." to open the JAR Selection dialog Message was edited by: hophuong
10 |5000 characters needed characters left characters exceeded

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

Denis Lapiner avatar image
Denis Lapiner answered
have you also set: java build path -> order and export -> amazon ads.jar ?
10 |5000 characters needed characters left characters exceeded

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

hophuong avatar image
hophuong answered
thank you so much.
10 |5000 characters needed characters left characters exceeded

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