question

yoonjy avatar image
yoonjy asked

Sample ads

Hi amazon lovers. There is a issue of Ads sample projects. this is error logs. 06-23 14:09:56.330: E/AndroidRuntime(13925): FATAL EXCEPTION: main 06-23 14:09:56.330: E/AndroidRuntime(13925): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amazon.sample.simplead/com.amazon.sample.simplead.SimpleAdActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.amazon.device.ads.AdLayout 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2304) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.ActivityThread.access$700(ActivityThread.java:165) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.os.Handler.dispatchMessage(Handler.java:99) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.os.Looper.loop(Looper.java:137) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.ActivityThread.main(ActivityThread.java:5450) 06-23 14:09:56.330: E/AndroidRuntime(13925): at java.lang.reflect.Method.invokeNative(Native Method) 06-23 14:09:56.330: E/AndroidRuntime(13925): at java.lang.reflect.Method.invoke(Method.java:525) 06-23 14:09:56.330: E/AndroidRuntime(13925): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187) 06-23 14:09:56.330: E/AndroidRuntime(13925): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 06-23 14:09:56.330: E/AndroidRuntime(13925): at dalvik.system.NativeStart.main(Native Method) 06-23 14:09:56.330: E/AndroidRuntime(13925): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.amazon.device.ads.AdLayout 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 06-23 14:09:56.330: E/AndroidRuntime(13925): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.Activity.setContentView(Activity.java:1956) 06-23 14:09:56.330: E/AndroidRuntime(13925): at com.amazon.sample.simplead.SimpleAdActivity.onCreate(SimpleAdActivity.java:27) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.Activity.performCreate(Activity.java:5369) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) 06-23 14:09:56.330: E/AndroidRuntime(13925): ... 11 more 06-23 14:09:56.330: E/AndroidRuntime(13925): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.amazon.device.ads.AdLayout" on path: /data/app/com.amazon.sample.simplead-1.apk 06-23 14:09:56.330: E/AndroidRuntime(13925): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65) 06-23 14:09:56.330: E/AndroidRuntime(13925): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 06-23 14:09:56.330: E/AndroidRuntime(13925): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.createView(LayoutInflater.java:565) 06-23 14:09:56.330: E/AndroidRuntime(13925): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 06-23 14:09:56.330: E/AndroidRuntime(13925): ... 21 more I don't know what's problem. I tried many things. but, still not work...
mobile ads
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
Please make sure that you have imported Amazon Ads SDK jar inside the apk. If it's only provided in compile time biut not imported in the apk the you should get the same exception reported followed by java.lang.ClassNotFoundException: Didn't find class "com.amazon.device.ads.AdLayout" on path: /data/app/com.amazon.sample.simplead-2.apk:/system/app/MetricsApi-2037410.apk:/system/app/com.amazon.dp.logger.apk
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
10 |5000

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

yoonjy avatar image
yoonjy answered
Thank you for reply. I already set the Java Build Path. This is Correct. After updating the android sdk, It's not work... Did you test the sample project in latest sdk?
10 |5000

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

Matt15@Amazon avatar image
Matt15@Amazon answered
Hey yoonjy, Please ensure that you have closely followed the instructions in the Readme file that accompanies the sample project. In particular, make sure that you have exported your jar. Let us know if you're still having an issue after checking that. Thanks.
10 |5000

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

yoonjy avatar image
yoonjy answered
thanks but It is still not working There are same errors. I already set the Jar Path correctly.. I don't know what's problem.
10 |5000

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

yoonjy avatar image
yoonjy answered
If amazon ads jar is not recognized, Change the Order and Export!!! So, Now It's works -yoonjy
10 |5000

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

Matt15@Amazon avatar image
Matt15@Amazon answered
Happy to help.
10 |5000

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