question

randomfeatures avatar image
randomfeatures asked

AmazonSDKTester can not find the JSON file

This is [b]NOT[/b] a question about my account or app status!!! This is a [b]ERROR[/b] I am getting from your test app! I need [b]HELP[/b] fixing the problem so that I can test my app. AmazonSDKTester is telling me that it can not find the JSON file. From the log: 09-26 18:52:41.319: E/AmazonSDKTester(6087): Unable to get item information during purchase 09-26 18:52:41.319: E/AmazonSDKTester(6087): com.amazon.testclient.TestClientException: JSON file does not exist on the device's external storage 09-26 18:52:41.319: E/AmazonSDKTester(6087): at com.amazon.testclient.discovery.DiscoveryClient.readFile(DiscoveryClient.java:94) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at com.amazon.testclient.discovery.DiscoveryClient.getItemData(DiscoveryClient.java:74) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at com.amazon.testclient.purchase.PurchaseAction.handlePurchaseFlow(PurchaseAction.java:84) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at com.amazon.testclient.KickstartService.onHandleIntent(KickstartService.java:38) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at android.os.Handler.dispatchMessage(Handler.java:99) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at android.os.Looper.loop(Looper.java:137) 09-26 18:52:41.319: E/AmazonSDKTester(6087): at android.os.HandlerThread.run(HandlerThread.java:60) As you can see from this screen capture on the device I put the file where the doc say to put it! http://www.random-features.net/device-2012-09-26.png
iap
10 |5000

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

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi, to test your app with Amazon SDK Tester, you need to make sure that "amazon.sdktester.json" resides under /mnt/sdcard/ folder in your device. For more information of testing your app with JSON file, please refer to the link - https://developer.amazon.com/sdk/in-app-purchasing/documentation/testing-iap.html#Create%20JSON. You can also configure the SDK Tester by following step-by-step guide we have. Please find the below SDK tester link and IAP link for more information. SDK Tester: https://developer.amazon.com/sdk.htm lAP : https://developer.amazon.com/sdk/in-app-purchasing.html Hope this information helps you.
10 |5000

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

randomfeatures avatar image
randomfeatures answered
Hi Samuel Thanks for almost reading my post. Please look at the screenshot I linked in my original post. http://www.random-features.net/device-2012-09-26.png /mnt/sdcard/ is exactly where I put the file.
10 |5000

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

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi randomfeatures, thanks for the screenshot. As your exception trace clearly shows that it is not able to find JSON file on device external storage, can you please check and confirm that you are able to identify and locate this JSON file in device using adb command.
10 |5000

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

randomfeatures avatar image
randomfeatures answered
Got it to work via help from stackoverflow. After the hard reset in step 5 it started working for me. 1. In newer verisons of Andorid under settings/developer there is a check box Protect USB storage. Apps must request permission to read USB storage. AmazonSDKTester does not ask for any permissions so make sure that this box is unchecked. 2. After you copy amazon.sdktester.json to the device Eject/Unmount your device 3. Force Close both your app & AmazonSDKTester 4. Clear AmazonSDKTester cache 5. If it still can not find the file then do a hard reset on the device. 6. Repeat from step 1 of necessary.
10 |5000

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

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi,Thanks for giving step by step procedure in solving this. It is good to know that you are able to solve this issue. I am sure that this will help other developers in the forum. Thanks again!
10 |5000

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

androidteam10 avatar image
androidteam10 answered
Thanks....ur code answer works .....
10 |5000

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

J. J. avatar image
J. J. answered
Hi, I am experiencing a similar issue with the SDK tester, but in Android 4.4.2 the "Protect USB Storage" option seems to be missing from the developer settings. Do you know of any workaround for this or whether that option has been renamed in the latest version of Android? I have verified that my json file is in the correct location and has the correct formatting. Here is the error I am receiving: E/AmazonSDKTester( 3128): Failure during handleItemDataRequest : java.io.FileNotFoundException: /storage/emulated/0/amazon.sdktester.json: open failed: EACCES (Permission denied) E/AmazonSDKTester( 3128): com.amazon.testclient.TestClientException: java.io.FileNotFoundException: /storage/emulated/0/amazon.sdktester.json: open failed: EACCES (Permission denied) -JJ > Got it to work via help from stackoverflow. After the > hard reset in step 5 it started working for me. > > 1. In newer verisons of Andorid under > settings/developer there is a check box Protect USB > storage. Apps must request permission to read USB > storage. AmazonSDKTester does not ask for any > permissions so make sure that this box is unchecked. > 2. After you copy amazon.sdktester.json to the device > Eject/Unmount your device > 3. Force Close both your app & AmazonSDKTester > 4. Clear AmazonSDKTester cache > 5. If it still can not find the file then do a hard > reset on the device. > 6. Repeat from step 1 of necessary.
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
Hi Jonasz, I am sending an apk of sdk tester to your registered mail id. Can you please check with it whether the issue is still there or not? If it is, please let us know the device make and model.
10 |5000

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

J. J. avatar image
J. J. answered
Hi, Yes, the version of the tester you emailed me works. Thank you.
10 |5000

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

mksin avatar image
mksin answered
Hi, I am running into same issue while testing on Galaxy S3 with Android 4.4.2. I just downloaded latest SDK to get the latest client. But I am still getting this error. E/AmazonSDKTester(6531): Unable to get item information during purchase E/AmazonSDKTester(6531): com.amazon.testclient.TestClientException: JSON file does not exist on the device's external storage E/AmazonSDKTester(6531): at com.amazon.testclient.discovery.DiscoveryClient.readFile(DiscoveryClient.java:92) E/AmazonSDKTester(6531): at com.amazon.testclient.discovery.DiscoveryClient.getItemData(DiscoveryClient.java:72) E/AmazonSDKTester(6531): at com.amazon.testclient.purchase.PurchaseAction.handlePurchaseFlow(PurchaseAction.java:84) E/AmazonSDKTester(6531): at com.amazon.testclient.KickstartService.onHandleIntent(KickstartService.java:38) E/AmazonSDKTester(6531): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) E/AmazonSDKTester(6531): at android.os.Handler.dispatchMessage(Handler.java:102) E/AmazonSDKTester(6531): at android.os.Looper.loop(Looper.java:157) E/AmazonSDKTester(6531): at android.os.HandlerThread.run(HandlerThread.java:61) E/AmazonSDKTester(6531): Error getting item data for 9f22e28f-eac9-42c1-8716-793b0ba1beba (remove_ads) I/AmazonSDKTester(6531): Sending Purchase Response Broadcast ({"requestId":"9f22e28f-eac9-42c1-8716-793b0ba1beba","purchaseStatus":"INVALID_SKU","userId":"DefaultTestUser"}) The file amazon.sdktester.json is in root of external SD card. I am not sure if that maps to /mnt/sdcard though. I'll appreciate your help. 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.