[Resolved] Amazon IAP question

I’m trying to get Amazon IAP to work.

Installed the Amazon App tester on my Kindle Fire, because otherwise the app would freeze after store.init

Now everything seems to be fine, it’s logged in, got user logged in, etc.

Now I actually use store.purchase(“itemname”), and the app crashes immediately.

Reading the logcat log i could narrow it down to this message:

01-28 10:14:27.789 E/AndroidRuntime(21502): FATAL EXCEPTION: main 01-28 10:14:27.789 E/AndroidRuntime(21502): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amazon.sdktestclient/com.amazon.sdktestclient.iap.ui.PurchaseActivity}: com.amazon.sdktestclient.SDKTesterException: JSON file does not exist on the device's external storage 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2035) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2060) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.ActivityThread.access$600(ActivityThread.java:127) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1181) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.os.Handler.dispatchMessage(Handler.java:99) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.os.Looper.loop(Looper.java:137) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.ActivityThread.main(ActivityThread.java:4558) 01-28 10:14:27.789 E/AndroidRuntime(21502): at java.lang.reflect.Method.invokeNative(Native Method) 01-28 10:14:27.789 E/AndroidRuntime(21502): at java.lang.reflect.Method.invoke(Method.java:511) 01-28 10:14:27.789 E/AndroidRuntime(21502): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 01-28 10:14:27.789 E/AndroidRuntime(21502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 01-28 10:14:27.789 E/AndroidRuntime(21502): at dalvik.system.NativeStart.main(Native Method) 01-28 10:14:27.789 E/AndroidRuntime(21502): Caused by: com.amazon.sdktestclient.SDKTesterException: JSON file does not exist on the device's external storage 01-28 10:14:27.789 E/AndroidRuntime(21502): at com.amazon.sdktestclient.iap.util.CatalogManager.readFile(CatalogManager.java:100) 01-28 10:14:27.789 E/AndroidRuntime(21502): at com.amazon.sdktestclient.iap.util.CatalogManager.getItemMap(CatalogManager.java:93) 01-28 10:14:27.789 E/AndroidRuntime(21502): at com.amazon.sdktestclient.iap.ui.PurchaseActivity.onCreatePurchaseActivity(PurchaseActivity.java:84) 01-28 10:14:27.789 E/AndroidRuntime(21502): at com.amazon.sdktestclient.iap.ui.PurchaseActivity.onCreate(PurchaseActivity.java) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.Activity.performCreate(Activity.java:4635) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 01-28 10:14:27.789 E/AndroidRuntime(21502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1999) 01-28 10:14:27.789 E/AndroidRuntime(21502): ... 11 more 01-28 10:14:27.812 I/AudioPolicyManagerBase(111): stopOutput() output 1, stream 3, session 89 01-28 10:14:27.820 I/AmazonInsightsSDK(21201): Session Pause Failed: Session is already paused. 01-28 10:14:27.820 V/GC\_ClickableToastImpl(21201): Tried to remove toast but none was attached. 01-28 10:14:27.820 I/System.out(21201): ----------Amazon GameCircle Released---------- 01-28 10:14:27.859 I/WindowManager(206): DIM BEHIND: Window{41b518b0 paused=false} 01-28 10:14:27.867 I/WindowManager(206): DIM BEHIND: Window{41b518b0 paused=false} 01-28 10:14:27.992 W/ActivityManager(206): Force finishing activity com.amazon.sdktestclient/.iap.ui.PurchaseActivity 01-28 10:14:27.992 V/ActivityStack(206): Prepare close transition: finishing ActivityRecord{4191bad8 com.amazon.sdktestclient/.iap.ui.PurchaseActivity} 01-28 10:14:27.992 W/ActivityManager(206): Force finishing activity com.rmbsoft.slots/com.ansca.corona.CoronaActivity 01-28 10:14:27.992 W/ActivityManager(206): com.amazon.sdktestclient has crashed. Not showing dialog. 01-28 10:14:27.992 E/AndroidRuntime(21502): Handle UnCaght exceptions. KILLING PID: 21502 01-28 10:14:28.000 I/ActivityManager(206): Process com.amazon.sdktestclient (pid 21502) has died.

Somewhere it says:

JSON file does not exist on the device’s external storage

Now do I really need to install the json file for the Apptester, like this page suggests?

https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/installing-and-configuring-app-tester

BTW The app is unpublished.

Hi rmbsoft,

Yes, you must configure the Amazon SDK Tester using the json file. Otherwise, the App Tester does not know how to reply to your application for various calls. It allows you to configure prices, pictures, names, etc. For your purchase example, the App Tester does not know if this is a valid product that can be purchased or not

Thanks, after putting the json file in place it worked.

Hi rmbsoft,

Yes, you must configure the Amazon SDK Tester using the json file. Otherwise, the App Tester does not know how to reply to your application for various calls. It allows you to configure prices, pictures, names, etc. For your purchase example, the App Tester does not know if this is a valid product that can be purchased or not

Thanks, after putting the json file in place it worked.