question

Alin Postolache avatar image
Alin Postolache asked

Amazon Mobile Ads Request Error

I'm trying to integrate the Amazon Mobile Ads SDK into my app. I've done everything which is described in the guide - https://developer.amazon.com/sdk/mobileads/quick-start.html

I've added the XML amazon layout like this:

<com.amazon.device.ads.AdLayout  
android:id="@+id/adview" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"
android:background="#fefefe"
android:layout_alignParentBottom="true"/>

2. I've included xmlns namespace in parent layout 3. Set all permissions manifest

4. Set AdActivity in manifest

5. Set Application Key

but i get a Request_error and this message: - "We will be unable to create a WebView for rendering an ad due to an unknown issue with the WebView."

Can anyone please tell me what seems to be the problem?

mobile ads
10 |3000 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.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Alin, Thank you for posting. In which device you are getting this issue? Is it Kindle Fire or non Amazon devices?
10 |3000 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
I get this too! Repeating the requesting again after 2-3 seconds solves it for me, but it seems to be a general bug... (I got it on nexus 4)
10 |3000 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.

Alin Postolache avatar image
Alin Postolache answered
I've been testing the SDK on a vodafone smart mini 875 phone
10 |3000 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.

Alin Postolache avatar image
Alin Postolache answered
I've tried to reload the ad but I keep getting this error!
10 |3000 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.

Bipin@Amazon avatar image
Bipin@Amazon answered
Error message = "We will be unable to create a WebView for rendering an ad due to an unknown issue with the WebView." Are you accessing the database and closing the connection gracefully. Both sdk and application would be concurrently accessing. If there is a problem accessing the database, you would be getting above error message. If the problem is not solved then, you can give me the code snippet in contact us( https://developer.amazon.com/help/contactus.html) , we would test the application in detail and pin point the error.
10 |3000 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.

Alin Postolache avatar image
Alin Postolache answered
Indeed - now I see that I'm having a error accesing the SQLite DB! Here's the stacktrace: 08-12 16:50:53.742: E/SQLiteLog(2079): (1802) statement aborts at 3: [DELETE FROM android_metadata] 08-12 16:50:53.742: E/SQLiteLog(2079): (1) statement aborts at 2: [ROLLBACK] cannot rollback - no transaction is active 08-12 16:50:53.749: E/SQLiteDatabase(2079): Failed to open database '/data/data/com.indieandroider.gratitudeapp/databases/webviewCache.db'. 08-12 16:50:53.749: E/SQLiteDatabase(2079): android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.indieandroider.gratitudeapp/databases/webviewCache.db' to 'en_US'. 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:386) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:882) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:871) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:215) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at com.amazon.device.ads.Utils.isWebViewOk(Utils.java:99) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at com.amazon.device.ads.AdLayout.isWebViewOk(AdLayout.java:703) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at com.amazon.device.ads.AdLayout.loadAd(AdLayout.java:490) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at com.indieandroider.gratitudeapp.MainActivity.onCreate(MainActivity.java:67) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.Activity.performCreate(Activity.java:5076) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ActivityThread.access$600(ActivityThread.java:150) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1301) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.os.Handler.dispatchMessage(Handler.java:99) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.os.Looper.loop(Looper.java:153) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.app.ActivityThread.main(ActivityThread.java:5006) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at java.lang.reflect.Method.invokeNative(Native Method) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at java.lang.reflect.Method.invoke(Method.java:511) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at dalvik.system.NativeStart.main(Native Method) 08-12 16:50:53.749: E/SQLiteDatabase(2079): Caused by: android.database.sqlite.SQLiteException: cannot rollback - no transaction is active (code 1) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:548) 08-12 16:50:53.749: E/SQLiteDatabase(2079): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:383) 08-12 16:50:53.749: E/SQLiteDatabase(2079): ... 29 more 08-12 16:50:53.753: E/AmazonMobileAds AdLayout(2079): We will be unable to create a WebView for rendering an ad due to an unknown issue with the WebView. Caused by: android.database.sqlite.SQLiteException: cannot rollback - no transaction is active (code 1) seems to be the problem but I don't understand why. Also I want to mention that I'm using the ORMLite library for object persistance in my app!
10 |3000 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.

Bipin@Amazon avatar image
Bipin@Amazon answered
Please narrow the problem by commenting all the code connecting to DB for now, we need to check if this is because of simultaneous access of database, The error is clearly showing that read/write access is not there and the application is not able to open or create the database - webviewCache.db.
10 |3000 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.

Martin avatar image
Martin answered
Hi there, I have exactly the same issue. I get that SQLite exception as well but don't use any database access at all in my app! Here's the log: [i]E/SQLiteLog(32539): (1802) statement aborts at 38: [CREATE TABLE IF NOT EXISTS android_metadata (locale TEXT)] disk I/O error E/SQLiteDatabase(32539): Failed to open database '/data/data/com.codeknitters.battleshiplite/databases/webviewCache.db'. E/SQLiteDatabase(32539): android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.codeknitters.battleshiplite/databases/webviewCache.db' to 'de_DE'. E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:397) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:222) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:197) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:812) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:797) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:702) E/SQLiteDatabase(32539): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:835) E/SQLiteDatabase(32539): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:824) E/SQLiteDatabase(32539): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:215) E/SQLiteDatabase(32539): at com.amazon.device.ads.Utils.isWebViewOk(Utils.java:99) E/SQLiteDatabase(32539): at com.amazon.device.ads.AdLayout.isWebViewOk(AdLayout.java:703) E/SQLiteDatabase(32539): at com.amazon.device.ads.AdLayout.loadAd(AdLayout.java:490) E/SQLiteDatabase(32539): at com.codeknitters.battleshiplite.BBAmazonAds.run(MonkeyGame.java:2755) E/SQLiteDatabase(32539): at android.os.Handler.handleCallback(Handler.java:615) E/SQLiteDatabase(32539): at android.os.Handler.dispatchMessage(Handler.java:92) E/SQLiteDatabase(32539): at android.os.Looper.loop(Looper.java:213) E/SQLiteDatabase(32539): at android.app.ActivityThread.main(ActivityThread.java:4787) E/SQLiteDatabase(32539): at java.lang.reflect.Method.invokeNative(Native Method) E/SQLiteDatabase(32539): at java.lang.reflect.Method.invoke(Method.java:511) E/SQLiteDatabase(32539): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) E/SQLiteDatabase(32539): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556) E/SQLiteDatabase(32539): at dalvik.system.NativeStart.main(Native Method) E/SQLiteDatabase(32539): Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 1802) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:559) E/SQLiteDatabase(32539): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:375) E/SQLiteDatabase(32539): ... 24 more E/AmazonMobileAds AdLayout(32539): We will be unable to create a WebView for rendering an ad due to an unknown issue with the WebView. [/i]
10 |3000 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.

Martin avatar image
Martin answered
As my app does not make any use of databases there is NO multiple access to it. My device is a Sony Xperia S, Android 4.1.2 installed.
10 |3000 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.

Martin avatar image
Martin answered
I really think this is related to this: http://stackoverflow.com/questions/7009699/sqlitediskioexception-error-code-10-disk-i-o-error Looks like the access is done way too early where the mounting hasn't completed yet. That would explain why it works for the guy above if he reloads it 2-3 seconds later.
10 |3000 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.