App freezes on 1st Generation Kindle Fire

Anybody else trying to test on a 1st generation KF? My app store code is working fine for google play (and iPad) but I freeze as I go into the app running my for-Amazon build on my KF. Get a bunch of errors like this in the log on build 1179, at a point that would correspond with calling store.init(). I haven’t investigated much yet, but these are not errors I’m used to seeing, and they look like the apk is broken or something.:

I/dalvikvm( 2875): Failed resolving Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler; interface 501 'Landroid/view/View$OnGenericMotionListener;' W/dalvikvm( 2875): Link of class 'Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler;' failed E/dalvikvm( 2875): Could not find class 'com.ansca.corona.input.ViewInputHandler$ApiLevel12$EventHandler', referenced from method com.ansca.corona.input.ViewInputHandler.\<init\> W/dalvikvm( 2875): VFY: unable to resolve new-instance 992 (Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler;) in Lcom/ansca/corona/input/ViewInputHandler; D/dalvikvm( 2875): VFY: replacing opcode 0x22 at 0x0009 D/dalvikvm( 2875): VFY: dead code 0x000b-000f in Lcom/ansca/corona/input/ViewInputHandler;.\<init\> ()V D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/liblua.so 0x40514fb0 D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/liblua.so 0x40514fb0 D/dalvikvm( 2875): No JNI\_OnLoad found in /data/data/com.primeadvocate.docjournal/lib/liblua.so 0x40514fb0, skipping init D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libjnlua5.1.so 0x40514fb0 D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/libjnlua5.1.so 0x40514fb0 D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libjnlua5.1.so 0x40514fb0 D/dalvikvm( 2875): Shared lib '/data/data/com.primeadvocate.docjournal/lib/libjnlua5.1.so' already loaded in same CL 0x40514fb0 I/dalvikvm( 2875): threadid=1: recursive native library load attempt (/data/data/com.primeadvocate.docjournal/lib/libjnlua5.1.so) D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libopenal.so 0x40514fb0 I/OpenAL\_SLES( 2875): alc\_opensles\_init D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/libopenal.so 0x40514fb0 D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libmpg123.so 0x40514fb0 D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/libmpg123.so 0x40514fb0 D/dalvikvm( 2875): No JNI\_OnLoad found in /data/data/com.primeadvocate.docjournal/lib/libmpg123.so 0x40514fb0, skipping init D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libvorbisidec.so 0x40514fb0 D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/libvorbisidec.so 0x40514fb0 D/dalvikvm( 2875): No JNI\_OnLoad found in /data/data/com.primeadvocate.docjournal/lib/libvorbisidec.so 0x40514fb0, skipping init D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libalmixer.so 0x40514fb0 D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/libalmixer.so 0x40514fb0 D/dalvikvm( 2875): No JNI\_OnLoad found in /data/data/com.primeadvocate.docjournal/lib/libalmixer.so 0x40514fb0, skipping init D/dalvikvm( 2875): Trying to load lib /data/data/com.primeadvocate.docjournal/lib/libcorona.so 0x40514fb0 D/dalvikvm( 2875): Added shared lib /data/data/com.primeadvocate.docjournal/lib/libcorona.so 0x40514fb0 I/dalvikvm( 2875): Failed resolving Lcom/ansca/corona/input/InputDeviceMonitor$ApiLevel16$EventHandler; interface 110 'Landroid/hardware/input/InputManager$InputDeviceListener;' W/dalvikvm( 2875): Link of class 'Lcom/ansca/corona/input/InputDeviceMonitor$ApiLevel16$EventHandler;' failed E/dalvikvm( 2875): Could not find class 'com.ansca.corona.input.InputDeviceMonitor$ApiLevel16$EventHandler', referenced from method com.ansca.corona.input.InputDeviceMonitor.\<init\> W/dalvikvm( 2875): VFY: unable to resolve new-instance 948 (Lcom/ansca/corona/input/InputDeviceMonitor$ApiLevel16$EventHandler;) in Lcom/ansca/corona/input/InputDeviceMonitor; D/dalvikvm( 2875): VFY: replacing opcode 0x22 at 0x001d D/dalvikvm( 2875): VFY: dead code 0x001f-0023 in Lcom/ansca/corona/input/InputDeviceMonitor;.\<init\> (Landroid/content/Context;)V D/libEGL&nbsp; ( 2875): loaded /system/lib/egl/libGLES\_android.so D/libEGL&nbsp; ( 2875): loaded /vendor/lib/egl/libEGL\_POWERVR\_SGX540\_120.so I/ActivityManager( 1400): Displayed com.primeadvocate.docjournal/com.ansca.corona.CoronaActivity: +309ms D/libEGL&nbsp; ( 2875): loaded /vendor/lib/egl/libGLESv1\_CM\_POWERVR\_SGX540\_120.so D/libEGL&nbsp; ( 2875): loaded /vendor/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so D/dalvikvm( 2875): Note: class Landroid/opengl/GLWrapperBase; has 211 unimplemented (abstract) methods V/GLSurfaceView( 2875): glGetString(7937) returns PowerVR SGX 540; I/dalvikvm( 2875): Total arena pages for JIT: 11 D/dalvikvm( 2875): GC\_FOR\_MALLOC freed 202K, 48% free 3014K/5703K, external 847K/1181K, paused 20ms I/dalvikvm-heap( 2875): Grow heap (frag case) to 7.398MB for 1320480-byte allocation D/dalvikvm( 2875): GC\_FOR\_MALLOC freed 8K, 40% free 4295K/7047K, external 847K/1181K, paused 18ms D/dalvikvm( 2875): GC\_CONCURRENT freed 15K, 40% free 4280K/7047K, external 847K/1181K, paused 2ms+2ms V/Corona&nbsp; ( 2875): \> Class.forName: network.LuaLoader V/Corona&nbsp; ( 2875): \< Class.forName: network.LuaLoader V/Corona&nbsp; ( 2875): Loading via reflection: network.LuaLoader D/dalvikvm( 2875): GC\_FOR\_MALLOC freed 1359K, 56% free 3121K/7047K, external 847K/1181K, paused 22ms I/dalvikvm-heap( 2875): Grow heap (frag case) to 7.511MB for 1320480-byte allocation D/dalvikvm( 2875): GC\_FOR\_MALLOC freed 0K, 38% free 4411K/7047K, external 847K/1181K, paused 25ms D/dalvikvm( 2875): GC\_CONCURRENT freed \<1K, 38% free 4410K/7047K, external 847K/1181K, paused 2ms+1ms V/Corona&nbsp; ( 2875): \> Class.forName: plugin.amazon.iap.LuaLoader V/Corona&nbsp; ( 2875): \< Class.forName: plugin.amazon.iap.LuaLoader V/Corona&nbsp; ( 2875): Loading via reflection: plugin.amazon.iap.LuaLoader D/skia&nbsp;&nbsp;&nbsp; ( 2875): Loading ARM decoder... D/skia&nbsp;&nbsp;&nbsp; ( 2875): Loading ARM decoder... &nbsp;

Can you paste in code?

Hi RealHandy,

I see from your log that your app is loading the Amazon IAP plugin, but the errors do not suggest that the plugin is the cause of your error. If you remove the plugin from your build.settings, does the app still crash on the Kindle Fire?

You can also test the Amazon IAP plugin on any Android device to rule out the Kindle Fire as being the culprit. Be sure to read the Amazon documentation and use the Amazon SDK Tester.

-Preston

Thanks to those who responded. I had some time to look into it further, and here’s what I found:

  1. It’s not the Kindle – I installed on my Nexus 7 with the Amazon store build and get the same behavior

  2. The problem is store.init(). it never returns from the call:

This works:

local store = require( "store" ) if device.isAmazonStore() then &nbsp;&nbsp; &nbsp;print( "YES THIS IS AMAZON STORE") &nbsp;&nbsp; &nbsp;store = require( "plugin.amazon.iap" ) &nbsp;&nbsp; &nbsp;print( "LOADED PLUGIN") end &nbsp;

Then this gets called. It’s the same call as for Google Play and iOS, so it should work:

print("storeinit") inAppPurchases.storeInit() &nbsp;

In storeInit, all that happens is this:

function inAppPurchases.storeInit() &nbsp;&nbsp; &nbsp;print( "in storeInit") &nbsp;&nbsp; &nbsp;store.init( storeTransactionCallback ) &nbsp;&nbsp; &nbsp;if device.isAmazonStore() then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;print("The currently logged in user is: ", store.getUserId()) &nbsp;&nbsp; &nbsp;end end &nbsp;

 

But I never see a print after the call to store.init(). I added that getUserId() call later, because my next print was outside the function. Nothing prints after store.init(). The app totally freezes and that’s that – I’m dead, no crash messages, just the app being non-responsive.

I have to say, I don’t know whether I’m testing correctly. I’m not using adb, I’m just installing my app and the SDK Tester on my device. I have the json file in place and use an on-device logcat tool to look at the logs. But I just lock up when store.init() is called.

Any help anyone can provide?

Hi RealHandy,

This behavior means that the Amazon IAP plugin and the Amazon SDK Tester(or Appstore client) are not communicating correctly.

Are you sure you have installed the Amazon SDK Tester on your device?

The other piece required for the Amazon IAP Plugin and the Amazon SDK Tester(or Appstore client) to communicate is an entry in the AndroidManifest.xml file. Are you able to look at the AndroidManifest.xml in the built apk? The following broadcast receiver should be present:

&nbsp;\<receiver android:name = "com.amazon.inapp.purchasing.ResponseReceiver" \> &nbsp; &nbsp; &nbsp; &nbsp; \<intent-filter\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<action android:name = "com.amazon.inapp.purchasing.NOTIFY" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY" /\> &nbsp; &nbsp; &nbsp; &nbsp; \</intent-filter\> &nbsp;\</receiver\> &nbsp;

This receiver should automatically be added by the Corona build process, but it is possible this was not added correctly.

-Preston

Definitely have the SDK Tester installed and running, can click the three orange buttons. Seems fine.

How would I know if my json file wasn’t formatted correctly? Could that possibly seize up the app on store.init()?

Manifest seems okay, found this in it with aapt:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=122) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.amazon.inapp.purchasing.ResponseReceiver" (Raw: "com.amazon.inapp.purchasing.ResponseReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=122) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=122) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.amazon.inapp.purchasing.NOTIFY" (Raw: "com.amazon.inapp.purchasing.NOTIFY") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:permission(0x01010006)="com.amazon.inapp.purchasing.Permission.NOTIFY" (Raw: "com.amazon.inapp.purchasing.Permission.NOTIFY") &nbsp;

Thanks for the help! It’s quite frustrating, since I don’t even get an error message back after in enters store.init() . . .

I also confirmed that my JSON file is valid JSON format and is located at /mnt/sdcard/amazon.sdktester.json . . .

Hi RealHandy,

Is there more in the logcat after the log you already posted that deal with the Amazon SDK Tester or the plugin?

Specifically, do you see any or all of the following lines?

D/PurchasingManager( 6348): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: plugin.amazon.iap.CoronaPurchasingObserver@406f2830 D/SandboxRequestHandler( 6348): In App Purchasing SDK - Sandbox Mode: sendGetUserIdRequest I/AmazonSDKTester( 6367): Sending UserId Response Broadcast ({"status":"SUCCESSFUL","requestId":"d568e62e-366c-4d7e-8b6b-8d96825f0575","userId":"DefaultTestUser"}) D/SandboxResponseHandler( 6348): In App Purchasing SDK - Sandbox Mode: handleResponse D/SandboxResponseHandler( 6348): In App Purchasing SDK - Sandbox Mode: Running Runnable for userIdResponse with requestId: d568e62e-366c-4d7e-8b6b-8d96825f0575 &nbsp;

Besides that, some of the entries in your original logcat snippet are concerning to me. Specifically:

I/dalvikvm( 2875): Failed resolving Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler; interface 501 'Landroid/view/View$OnGenericMotionListener;' W/dalvikvm( 2875): Link of class 'Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler;' failed E/dalvikvm( 2875): Could not find class 'com.ansca.corona.input.ViewInputHandler$ApiLevel12$EventHandler', referenced from method com.ansca.corona.input.ViewInputHandler.\<init\> W/dalvikvm( 2875): VFY: unable to resolve new-instance 992 (Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler;) in Lcom/ansca/corona/input/ViewInputHandler; D/dalvikvm( 2875): VFY: replacing opcode 0x22 at 0x0009 D/dalvikvm( 2875): VFY: dead code 0x000b-000f in Lcom/ansca/corona/input/ViewInputHandler;.\<init\> () &nbsp;

Does your app work otherwise if you stub out or otherwise remove the calls to the store library? It is possible that there is a deeper root cause with the android build that are the ultimate problem. 

One more question about the snippet you posted from your AndroidManifiest.xml: Is the <receiver> tag nested under the <application> tag?

I have only these lines from the SDK Tester or plugin:

D/PurchasingManager(10344): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: plugin.amazon.iap.CoronaPurchasingObserver@4051ef70 I/PurchasingManager(10344): Purchasing Framework initialization complete. Build ID 1.0.3 I/AmazonSDKTester(10271): Init Complete. on line 8 of file:///android\_asset/web/js/index.js &nbsp;

No SandboxRequestHandler or SandboxResponseHandler at all.

And the app works fine if I just comment out the inAppPurchases.storeInit() – which is what never completes – and the loadProducts() that is never reached. No Amazon store calls, everything works fine. The plugin still loads, I just don’t call it, and no freeze.

I’ve uninstalled and reinstalled Corona and moved up to build 1181. Nothing has changed. My app works fine as long as I don’t call the plugin’s store.init(). If I do, that call never returns and I’m frozen.

I’m unsure how to answer the question about the androidmanifest.xml, “Is the <receiver> tag nested under the <application> tag”.

Here’s the entirety of the manifest (I think – I’m not familiar with the aapt output format):

N: android=http://schemas.android.com/apk/res/android &nbsp; E: manifest (line=2) &nbsp;&nbsp;&nbsp; A: android:versionCode(0x0101021b)=(type 0x10)0x1 &nbsp;&nbsp;&nbsp; A: android:versionName(0x0101021c)="1.0" (Raw: "1.0") &nbsp;&nbsp;&nbsp; A: android:installLocation(0x010102b7)=(type 0x10)0x0 &nbsp;&nbsp;&nbsp; A: package="com.primeadvocate.docjournal" (Raw: "com.primeadvocate.docjournal") &nbsp;&nbsp;&nbsp; E: uses-sdk (line=13) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:minSdkVersion(0x0101020c)=(type 0x10)0x8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:targetSdkVersion(0x01010270)=(type 0x10)0x10 &nbsp;&nbsp;&nbsp; E: uses-permission (line=17) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") &nbsp;&nbsp;&nbsp; E: uses-permission (line=18) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.android.vending.CHECK\_LICENSE" (Raw: "com.android.vending.CHECK\_LICENSE") &nbsp;&nbsp;&nbsp; E: uses-permission (line=19) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.android.vending.BILLING" (Raw: "com.android.vending.BILLING") &nbsp;&nbsp;&nbsp; E: uses-feature (line=22) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:glEsVersion(0x01010281)=(type 0x11)0x10001 &nbsp;&nbsp;&nbsp; E: uses-feature (line=23) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="android.hardware.telephony" (Raw: "android.hardware.telephony") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:required(0x0101028e)=(type 0x12)0x0 &nbsp;&nbsp;&nbsp; E: application (line=32) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:label(0x01010001)="DocJournal" (Raw: "DocJournal") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:icon(0x01010002)=@0x7f020026 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: meta-data (line=37) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="targetedAppStore" (Raw: "targetedAppStore") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:value(0x01010024)="amazon" (Raw: "amazon") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: activity (line=44) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:label(0x01010001)="DocJournal" (Raw: "DocJournal") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.CoronaActivity" (Raw: "com.ansca.corona.CoronaActivity") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:launchMode(0x0101001d)=(type 0x10)0x2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:screenOrientation(0x0101001e)=(type 0x10)0x1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: meta-data (line=50) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="supportsOrientationPortrait" (Raw: "supportsOrientationPortrait") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:value(0x01010024)=(type 0x12)0xffffffff &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: meta-data (line=51) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="supportsOrientationPortraitUpsideDown" (Raw: "supportsOrientationPortraitUpsideDo wn") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:value(0x01010024)=(type 0x12)0x0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: meta-data (line=52) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="supportsOrientationLandscapeRight" (Raw: "supportsOrientationLandscapeRight") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:value(0x01010024)=(type 0x12)0x0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: meta-data (line=53) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="supportsOrientationLandscapeLeft" (Raw: "supportsOrientationLandscapeLeft") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:value(0x01010024)=(type 0x12)0x0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=54) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=55) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: category (line=56) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: activity (line=62) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.CameraActivity" (Raw: "com.ansca.corona.CameraActivity") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:screenOrientation(0x0101001e)=(type 0x10)0x1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: activity (line=66) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.VideoActivity" (Raw: "com.ansca.corona.VideoActivity") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: activity (line=69) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.purchasing.StoreActivity" (Raw: "com.ansca.corona.purchasing.Store Activity") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: activity (line=72) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.facebook.LoginActivity" (Raw: "com.facebook.LoginActivity") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: activity (line=75) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.facebook.FacebookFragmentActivity" (Raw: "com.ansca.corona.faceboo k.FacebookFragmentActivity") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: provider (line=80) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.FileContentProvider" (Raw: "com.ansca.corona.FileContentProvider") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:authorities(0x01010018)="com.primeadvocate.docjournal.files" (Raw: "com.primeadvocate.docjournal.file s") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: service (line=84) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.CoronaService" (Raw: "com.ansca.corona.CoronaService") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=92) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.SystemStartupBroadcastReceiver" (Raw: "com.ansca.corona.SystemStartupBroadcastReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=93) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=94) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="android.intent.action.BOOT\_COMPLETED" (Raw: "android.intent.action.BOOT\_COMPLETED") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=99) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.notifications.AlarmManagerBroadcastReceiver" (Raw: "com.ansca.corona.notifications.AlarmManagerBroadcastReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=100) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.notifications.StatusBarBroadcastReceiver" (Raw: "com.ansca.corona.notifications.StatusBarBroadcastReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=103) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver" (Raw: "com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:permission(0x01010006)="com.google.android.c2dm.permission.SEND" (Raw: "com.google.android.c2dm.permission.SEND") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=105) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=106) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.google.android.c2dm.intent.RECEIVE" (Raw: "com.google.android.c2dm.intent.RECEIVE") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=107) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.google.android.c2dm.intent.REGISTRATION" (Raw: "com.google.android.c2dm.intent.REGISTRATION") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: category (line=108) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.primeadvocate.docjournal" (Raw: "com.primeadvocate.docjournal") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=113) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.ansca.corona.purchasing.GoogleStoreBroadcastReceiver" (Raw: "com.ansca.corona.purchasing.GoogleStoreBroadcastReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=114) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=115) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.android.vending.billing.IN\_APP\_NOTIFY" (Raw: "com.android.vending.billing.IN\_APP\_NOTIFY") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=116) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.android.vending.billing.RESPONSE\_CODE" (Raw: "com.android.vending.billing.RESPONSE\_CODE") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=117) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.android.vending.billing.PURCHASE\_STATE\_CHANGED" (Raw: "com.android.vending.billing.PURCHASE\_STATE\_CHANGED") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=121) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.amazon.inapp.purchasing.ResponseReceiver" (Raw: "com.amazon.inapp.purchasing.ResponseReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=121) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=121) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.amazon.inapp.purchasing.NOTIFY" (Raw: "com.amazon.inapp.purchasing.NOTIFY") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:permission(0x01010006)="com.amazon.inapp.purchasing.Permission.NOTIFY" (Raw: "com.amazon.inapp.purchasing.Permission.NOTIFY") &nbsp;

I have resolved the problem. Only for Amazon and not for Apple or Google, store.init() was never returning because, just before that call to store.init(), I was doing this. Something about these calls (the check() functions do DB reads and call showAlert() to pop up warnings under some circumstances) was causing the problem, because as soon as I moved these lines to AFTER the call to store.init(), everything worked fine:

systemEvents.addAction( "applicationResume", "checkForUpdate", checkForUpdate.check ) &nbsp;&nbsp; &nbsp;checkForUpdate.check() systemEvents.addAction( "applicationResume", "checkForBackup", checkForBackup.check ) &nbsp;&nbsp;&nbsp; checkForBackup.check()

systemEvents.addAction(…)

what does the function do? I can’t find it in the docs.

I totally forgot that it wasn’t a system call, it’s my own layer on top of Runtime:addEventListener( “system”, listener ). Those calls to addAction() are just adding to an array of functions that are run when an “applicationResume” system event occurs. But the explicit calls to checkForBackup.check() and checkForUpdate.check() actually do things right when called.

checkForBackup.check() just does a DB read and pops a native.showAlert() if the user hasn’t done a backup lately. I guess the showAlert() at that point could conceivably be an issue for the IAP plugin.

checkForUpdate.check() does this, which might also be the issue:

function checkForUpdate.check() &nbsp;&nbsp; &nbsp;network.request( "http://itunes.apple.com/lookup?id=" .. checkForUpdate.appId, "GET", checkForUpdate.checkListener,&nbsp; nil ) end &nbsp;

Can you paste in code?

Hi RealHandy,

I see from your log that your app is loading the Amazon IAP plugin, but the errors do not suggest that the plugin is the cause of your error. If you remove the plugin from your build.settings, does the app still crash on the Kindle Fire?

You can also test the Amazon IAP plugin on any Android device to rule out the Kindle Fire as being the culprit. Be sure to read the Amazon documentation and use the Amazon SDK Tester.

-Preston

Thanks to those who responded. I had some time to look into it further, and here’s what I found:

  1. It’s not the Kindle – I installed on my Nexus 7 with the Amazon store build and get the same behavior

  2. The problem is store.init(). it never returns from the call:

This works:

local store = require( "store" ) if device.isAmazonStore() then &nbsp;&nbsp; &nbsp;print( "YES THIS IS AMAZON STORE") &nbsp;&nbsp; &nbsp;store = require( "plugin.amazon.iap" ) &nbsp;&nbsp; &nbsp;print( "LOADED PLUGIN") end &nbsp;

Then this gets called. It’s the same call as for Google Play and iOS, so it should work:

print("storeinit") inAppPurchases.storeInit() &nbsp;

In storeInit, all that happens is this:

function inAppPurchases.storeInit() &nbsp;&nbsp; &nbsp;print( "in storeInit") &nbsp;&nbsp; &nbsp;store.init( storeTransactionCallback ) &nbsp;&nbsp; &nbsp;if device.isAmazonStore() then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;print("The currently logged in user is: ", store.getUserId()) &nbsp;&nbsp; &nbsp;end end &nbsp;

 

But I never see a print after the call to store.init(). I added that getUserId() call later, because my next print was outside the function. Nothing prints after store.init(). The app totally freezes and that’s that – I’m dead, no crash messages, just the app being non-responsive.

I have to say, I don’t know whether I’m testing correctly. I’m not using adb, I’m just installing my app and the SDK Tester on my device. I have the json file in place and use an on-device logcat tool to look at the logs. But I just lock up when store.init() is called.

Any help anyone can provide?

Hi RealHandy,

This behavior means that the Amazon IAP plugin and the Amazon SDK Tester(or Appstore client) are not communicating correctly.

Are you sure you have installed the Amazon SDK Tester on your device?

The other piece required for the Amazon IAP Plugin and the Amazon SDK Tester(or Appstore client) to communicate is an entry in the AndroidManifest.xml file. Are you able to look at the AndroidManifest.xml in the built apk? The following broadcast receiver should be present:

&nbsp;\<receiver android:name = "com.amazon.inapp.purchasing.ResponseReceiver" \> &nbsp; &nbsp; &nbsp; &nbsp; \<intent-filter\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<action android:name = "com.amazon.inapp.purchasing.NOTIFY" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY" /\> &nbsp; &nbsp; &nbsp; &nbsp; \</intent-filter\> &nbsp;\</receiver\> &nbsp;

This receiver should automatically be added by the Corona build process, but it is possible this was not added correctly.

-Preston

Definitely have the SDK Tester installed and running, can click the three orange buttons. Seems fine.

How would I know if my json file wasn’t formatted correctly? Could that possibly seize up the app on store.init()?

Manifest seems okay, found this in it with aapt:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: receiver (line=122) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.amazon.inapp.purchasing.ResponseReceiver" (Raw: "com.amazon.inapp.purchasing.ResponseReceiver") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: intent-filter (line=122) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E: action (line=122) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:name(0x01010003)="com.amazon.inapp.purchasing.NOTIFY" (Raw: "com.amazon.inapp.purchasing.NOTIFY") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: android:permission(0x01010006)="com.amazon.inapp.purchasing.Permission.NOTIFY" (Raw: "com.amazon.inapp.purchasing.Permission.NOTIFY") &nbsp;

Thanks for the help! It’s quite frustrating, since I don’t even get an error message back after in enters store.init() . . .

I also confirmed that my JSON file is valid JSON format and is located at /mnt/sdcard/amazon.sdktester.json . . .

Hi RealHandy,

Is there more in the logcat after the log you already posted that deal with the Amazon SDK Tester or the plugin?

Specifically, do you see any or all of the following lines?

D/PurchasingManager( 6348): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: plugin.amazon.iap.CoronaPurchasingObserver@406f2830 D/SandboxRequestHandler( 6348): In App Purchasing SDK - Sandbox Mode: sendGetUserIdRequest I/AmazonSDKTester( 6367): Sending UserId Response Broadcast ({"status":"SUCCESSFUL","requestId":"d568e62e-366c-4d7e-8b6b-8d96825f0575","userId":"DefaultTestUser"}) D/SandboxResponseHandler( 6348): In App Purchasing SDK - Sandbox Mode: handleResponse D/SandboxResponseHandler( 6348): In App Purchasing SDK - Sandbox Mode: Running Runnable for userIdResponse with requestId: d568e62e-366c-4d7e-8b6b-8d96825f0575 &nbsp;

Besides that, some of the entries in your original logcat snippet are concerning to me. Specifically:

I/dalvikvm( 2875): Failed resolving Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler; interface 501 'Landroid/view/View$OnGenericMotionListener;' W/dalvikvm( 2875): Link of class 'Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler;' failed E/dalvikvm( 2875): Could not find class 'com.ansca.corona.input.ViewInputHandler$ApiLevel12$EventHandler', referenced from method com.ansca.corona.input.ViewInputHandler.\<init\> W/dalvikvm( 2875): VFY: unable to resolve new-instance 992 (Lcom/ansca/corona/input/ViewInputHandler$ApiLevel12$EventHandler;) in Lcom/ansca/corona/input/ViewInputHandler; D/dalvikvm( 2875): VFY: replacing opcode 0x22 at 0x0009 D/dalvikvm( 2875): VFY: dead code 0x000b-000f in Lcom/ansca/corona/input/ViewInputHandler;.\<init\> () &nbsp;

Does your app work otherwise if you stub out or otherwise remove the calls to the store library? It is possible that there is a deeper root cause with the android build that are the ultimate problem. 

One more question about the snippet you posted from your AndroidManifiest.xml: Is the <receiver> tag nested under the <application> tag?