question

robin avatar image
robin asked ·

v2 Entitlement Sample Sandbox Mode: Error in sendResponse: java.lang.NullPo

Have attempted v2 Entitlement Sample - d/l SDK on Wed 2014.07.30 v2 Entitlement Sample Sandbox Mode: Error in sendResponse: java.lang.NullPointerException InAppPurchasing\2.0\samples\SampleIAPEntitlementsApp Compiled SDK source unchanged Verified amazon.sdktester.json in mnt/sdcard/ and string id matched in MySku.java "com.amazon.sample.iap.entitlement.level2" Manifest contains element receiver node - v2 receiver android:name="com.amazon.device.iap.ResponseReceiver" Donwloaded new Amazon App Tester per: http://forums.developer.amazon.com/forums/thread.jspa?threadID=3735&tstart=0 Removed v1 SDK tester per: "No value for priceJson" http://forums.developer.amazon.com/forums/thread.jspa?threadID=3787&tstart=0 Unable to locate suitable setup instructions for any of the IAP samples Hard reboot of Kindle. Reboot of PC and fresh restart Eclipse 3.8 07-30 20:41:17.553: D/c(4018): In App Purchasing SDK - Sandbox Mode: handleResponse 07-30 20:41:17.553: D/SampleIAPEntitlementsApp(4018): onGetUserDataResponse: requestId (1d3ed972-8609-4bc1-9a4f-2e39a6a499d4) userIdRequestStatus: SUCCESSFUL) 07-30 20:41:17.553: D/SampleIAPEntitlementsApp(4018): onUserDataResponse: get user id (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=, marketplace (US) 07-30 20:41:17.560: D/c(4018): In App Purchasing SDK - Sandbox Mode: handleResponse 07-30 20:41:17.560: I/c(4018): sendGetPurchaseUpdates with user idl3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU= 07-30 20:41:17.560: I/c(4018): send PurchaseUpdates with user id:l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=;reset flag:false, local cursor:0, parsed from old requestId:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:0:e9d3c53d-1f1e-41d3-9665-8a07a0e8f5ff 07-30 20:41:17.779: D/c(4018): In App Purchasing SDK - Sandbox Mode: handleResponse 07-30 20:41:17.779: I/c(4018): Offset for PurchaseUpdatesResponse:0 07-30 20:41:17.795: D/SampleIAPEntitlementsApp(4018): onPurchaseUpdatesResponse: requestId (5e50bc9a-de0f-4c33-a40f-9b4d4aac7d9d) purchaseUpdatesResponseStatus (SUCCESSFUL) userId (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=) 07-30 20:41:17.795: D/SampleIAPManager(4018): getEntitlementRecordBySku: userId (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=), sku (com.amazon.sample.iap.entitlement.level2) 07-30 20:41:17.803: D/SampleIAPManager(4018): getEntitlementRecordBySku: no record found 07-30 20:41:17.810: E/c(4018): In App Purchasing SDK - Sandbox Mode: Error in sendResponse: java.lang.NullPointerException Unable to locate method getEntitlementRecordBySku() in SampleIAPManager.java as LogCat indicates Also note that the 'Buy Acces to Level 2' is not hilited, so only option is to close the SDK sample
iap
10 |2000 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.

Eric@Amazon avatar image
Eric@Amazon answered ·
Hi robin, Thank you for your feedback. I confirmed the NullPointerException in the log. I have forwarded it to the engineering team to review. However, I was unable to reproduce your issue. The sample app is functioning even with the NullPointerException in the log. Can you check the onProductDataResponse in the log? It should look something like this: D/SampleIAPEntitlementsApp(11978): onProductDataResponse: RequestStatus (SUCCESSFUL) D/SampleIAPEntitlementsApp(11978): onProductDataResponse: successful. The item data map in this response includes the valid SKUs D/SampleIAPEntitlementsApp(11978): onProductDataResponse: 0 unavailable skus Thanks
10 |2000 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.

robin avatar image
robin answered ·
Eric, Thank you for taking a look. I re-ran the app today, Sat Aug 02, restart Kindle and reboot PC and seem to get the same response as you did. My instance however, hangs immediately after the exception, with the button in an inactive state. 08-02 11:49:20.650: D/c(10168): In App Purchasing SDK - Sandbox Mode: sendPurchaseUpdatesRequest/sendGetUserData first:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:0:aaceb7d0-66c2-4240-a551-dd7c34787450 08-02 11:49:20.814: D/libEGL(10168): loaded /system/lib/egl/ libGLES_android.so 08-02 11:49:20.814: D/libEGL(10168): loaded /vendor/lib/egl/ libEGL_POWERVR_SGX540_120.so 08-02 11:49:20.837: D/libEGL(10168): loaded /vendor/lib/egl/ libGLESv1_CM_POWERVR_SGX540_120.so 08-02 11:49:20.837: D/libEGL(10168): loaded /vendor/lib/egl/ libGLESv2_POWERVR_SGX540_120.so 08-02 11:49:20.978: D/OpenGLRenderer(10168): Enabling debug mode 0 08-02 11:49:22.916: D/SampleIAPEntitlementsApp(10168): onResume: call getUserData 08-02 11:49:22.916: D/c(10168): In App Purchasing SDK - Sandbox Mode: sendGetUserDataRequest 08-02 11:49:22.939: D/SampleIAPEntitlementsApp(10168): onResume: getPurchaseUpdates 08-02 11:49:22.939: D/c(10168): In App Purchasing SDK - Sandbox Mode: sendPurchaseUpdatesRequest/sendGetUserData first:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:0:0840a087-949e-48a3-8bf0-68ec5df21096 08-02 11:49:23.087: D/c(10168): In App Purchasing SDK - Sandbox Mode: handleResponse 08-02 11:49:23.087: D/SampleIAPEntitlementsApp(10168): onProductDataResponse: RequestStatus (SUCCESSFUL) 08-02 11:49:23.087: D/SampleIAPEntitlementsApp(10168): onProductDataResponse: successful. The item data map in this response includes the valid SKUs 08-02 11:49:23.087: D/SampleIAPEntitlementsApp(10168): onProductDataResponse: 0 unavailable skus 08-02 11:49:23.087: D/c(10168): In App Purchasing SDK - Sandbox Mode: handleResponse 08-02 11:49:23.095: D/SampleIAPEntitlementsApp(10168): onGetUserDataResponse: requestId (cf6ce3c5-ee14-42dd-a52a-4500b0c08202) userIdRequestStatus: SUCCESSFUL) 08-02 11:49:23.095: D/SampleIAPEntitlementsApp(10168): onUserDataResponse: get user id (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=, marketplace (US) 08-02 11:49:23.095: D/SampleIAPManager(10168): getEntitlementRecordBySku: userId (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=), sku (com.amazon.sample.iap.entitlement.level2) 08-02 11:49:23.095: D/SampleIAPManager(10168): getEntitlementRecordBySku: no record found 08-02 11:49:23.095: E/c(10168): In App Purchasing SDK - Sandbox Mode: Error in sendResponse: java.lang.NullPointerException 08-02 11:49:23.095: D/c(10168): In App Purchasing SDK - Sandbox Mode: handleResponse 08-02 11:49:23.103: I/c(10168): sendGetPurchaseUpdates with user idl3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU= 08-02 11:49:23.228: I/c(10168): send PurchaseUpdates with user id:l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=;reset flag:false, local cursor:0, parsed from old requestId:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:0:aaceb7d0-66c2-4240-a551-dd7c34787450 08-02 11:49:23.259: D/c(10168): In App Purchasing SDK - Sandbox Mode: handleResponse I reviewed: Under 'Entitlement' 1. Bring the Purchase Window to the foreground by clicking on the Buy Access to Level 2 button. https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/implement-consumables-entitlements-and-subscriptions-in-iap-2.0#5.%20Building,%20Installing,%20and%20Running%20the%20Sample%20App%20in%20Sandbox%20%28Test%29%20Mode but unable to advance as my instance is created with the button in an inactive state.
10 |2000 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.

Eric@Amazon avatar image
Eric@Amazon answered ·
Hi robin, Thanks for the update. The log shows onProductDataResponse was successful, so I would expect the buy button to be available. Can you tell me which Kindle model you are testing with? Can you try force-closing & clearing app data of the sample app and see if that help? If the problem persist, try put some logging in setLevel2Availbility() inside MainActivity.java. That should tell us why the buy button is not enabled. Thanks
10 |2000 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.

robin avatar image
robin answered ·
KF HD 7 2nd gen KFTT Current sync version 7.4.9 Could you please explain what exact steps you would like me to perform for a 'force-closing' and what app data exactly, and steps to remove, as the app isn't apparently loading, indicated by the early termination of log cat entries. The log ends abruptly a few lines after 'sendResponse: java.lang.NullPointerException' as indicated by both listings previously posted. The only way I am able to currently terminate is the left facing arrow on the SoftKey input panel, and have even tried to hold the power button in for ten seconds to force a cold reboot. After re-reading this post, IAP v2 is now not an immediate priority for my app submission requirement(s). https://forums.developer.amazon.com/forums/thread.jspa?threadID=3826 I will however continue to provide detail for the SDK team on a time available basis in order to locate what was omitted from the recent v2 SDK deployment. I'll put some effort into peppering those functions with debug log entries this weekend, or if there is existing debug function sections available that I may cut-n-paste into the SDK example, or the entire MainActivity.java file or others, I could compile and run that for the SDK team. I am compiling with the v2 SDK files (July 30 d/l) unedited at this time.
10 |2000 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.

Eric@Amazon avatar image
Eric@Amazon answered ·
Hi robin, You can follow these steps to force close an app and clear it's app data: 1. Swipe down from the top of the screen to show Quick Settings 2. Select More... > Applications > Installed Applications 3. Select "SampleIAPEntitlementsApp" in the list 4. Tap Force stop 5. Tap Clear Data Please also double-check that you are running the latest version of Amazon App Tester, version 2.0.0.11 If that doesn't work, please try the following apk. It is the same sample app, but with additional logging and status message. http://tinyurl.com/mkcxd9u You can side-load it onto your Kindle through this command: adb install Here is a un-modified copy of the json file from the sample: http://tinyurl.com/orxye62 Here is the source code in case you are interested: http://tinyurl.com/q4wed7a Regarding the NullPointerException, I confirmed with the SDK team that it is safe to ignore. It does not impact the functionality of the sample app. Thanks
10 |2000 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.

robin avatar image
robin answered ·
Eric, Thank you for the quick response. Instructions excellent. I only wish the other Amazonian staff members took the time to be so thorough. Kudos. Tried clearing data from the settings menu, but had the same result, button not hilited. On to your .apk Although I did mention in the original post I had d/l the new Amazon App Tester, I again verified 2.0.0.11 As I had been sideloading along with Eclipse run configurations, and that I noticed your .apk file name matched the batch files I had already setup, it became a no brainer to perform the sideload. The .apk performs the same, loading with the 'Buy Access to Level 2' button disabled and one additional line, 'Status: Product is not available' The log is rather long, from app start to forced close when button not hilited. Again Eric, thank you for being so thorough. 08-06 23:25:56.703: I/Sensors(205): **** Motion **** 08-06 23:25:57.125: V/Sensors(205): accel data: 0.402363 -0.301772 10.224339 08-06 23:26:01.781: I/ActivityManager(205): Start proc com.amazon.avod for service com.amazon.avod/.syncservice.SyncService: pid=7523 uid=32000 gids={3003, 1015, 3002} 08-06 23:26:02.055: V/Sensors(205): accel data: 0.493374 -0.390388 9.632769 08-06 23:26:03.461: D/PlayreadyPlugIn(1692): PlayreadyPlugin::onInitialize : 2701 08-06 23:26:03.461: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onSetOnInfoListener : 2701 08-06 23:26:03.461: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::canHandle: playready://AllExpiredLicenses.playready 08-06 23:26:03.461: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onRemoveRights() : 2701 08-06 23:26:03.461: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn: Attempting to initiialise context 08-06 23:26:03.461: I/PlayreadyPlugin(1692): Drm_Initialize 08-06 23:26:03.563: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn: remove expired licenses 08-06 23:26:03.563: I/PlayreadyPlugin(1692): Drm_Initialize: return 0x00000000 08-06 23:26:03.602: I/PlayreadyPlugin(1692): Drm_Uninitialize 08-06 23:26:03.711: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onAcquireDrmInfo uniqueId : 2701 08-06 23:26:03.711: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onAcquireDrmInfo get challenge from agent 08-06 23:26:03.711: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn: Attempting to initiialise context 08-06 23:26:03.711: I/PlayreadyPlugin(1692): Drm_Initialize 08-06 23:26:03.774: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onAcquireDrmInfo HeaderLength: 23 08-06 23:26:03.774: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onAcquireDrmInfo error in deccode B64: 08-06 23:26:03.774: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onAcquireDrmInfo test 1 08-06 23:26:03.774: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::onAcquireDrmInfo test 2 08-06 23:26:03.774: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn: Error in Set Prop. 08-06 23:26:03.774: D/PlayreadyPlugIn(1692): DrmPlayreadyPlugIn::Error in Acq : 80070057 08-06 23:26:03.774: I/PlayreadyPlugin(1692): Drm_Initialize: return 0x00000000 08-06 23:26:03.774: I/PlayreadyPlugin(1692): Drm_Content_SetProperty 08-06 23:26:03.774: I/PlayreadyPlugin(1692): Drm_Uninitialize 08-06 23:26:04.117: I/ActivityManager(205): No longer want com.android.gallery3d (pid 6953): hidden #16 08-06 23:26:04.867: I/Sensors(205): **** No Motion **** 08-06 23:26:06.977: V/Sensors(205): accel data: 0.524509 -0.371228 9.649533 08-06 23:26:07.602: I/ChargeProtectionService(205): New full charge capacity, adjust charge current 08-06 23:26:07.602: I/ChargeProtectionService(205): New charge current: 2963 mA 08-06 23:26:09.867: V/LocationManagerService(205): isAllowedBySettingsLocked Providers : network 08-06 23:26:09.867: V/LocationManagerService(205): Checking in Secure Settings 08-06 23:26:09.867: V/LocationManagerService(205): isAllowedBySettingsLocked Providers : passive 08-06 23:26:09.867: V/LocationManagerService(205): Provider was in mEnabledProviders 08-06 23:26:10.610: D/dalvikvm(205): GC_CONCURRENT freed 1577K, 35% free 17741K/27143K, paused 2ms+5ms 08-06 23:26:11.899: V/Sensors(205): accel data: 0.546064 -0.390388 9.649533 08-06 23:26:16.820: V/Sensors(205): accel data: 0.459844 -0.368833 9.659114 08-06 23:26:21.742: V/Sensors(205): accel data: 0.519719 -0.404758 9.630374 08-06 23:26:25.891: I/Sensors(205): **** Motion **** 08-06 23:26:26.656: V/ActivityStack(205): Prepare close transition: finishing ActivityRecord{415e0240 com.amazon.sample.iap.entitlement/.MainActivity} 08-06 23:26:26.656: V/ActivityStack(205): Prepare close transition: prev=ActivityRecord{415e0240 com.amazon.sample.iap.entitlement/.MainActivity} 08-06 23:26:26.664: V/Sensors(205): accel data: 3.542234 -0.682581 9.031619 08-06 23:26:26.750: V/PhoneStatusBar(297): setLightsOn(true) 08-06 23:26:26.977: D/OpenGLRenderer(7477): Flushing caches (mode 0) 08-06 23:26:27.094: I/ActivityManager(205): No longer want com.amazon.identity.auth.device.authorization (pid 6979): hidden #16 08-06 23:26:27.102: D/OpenGLRenderer(7477): Flushing caches (mode 1) 08-06 23:26:31.586: V/Sensors(205): accel data: 0.888552 -0.311353 9.733359 08-06 23:26:36.508: V/Sensors(205): accel data: 0.878972 -0.354463 9.601633 08-06 23:26:37.985: I/Sensors(205): **** No Motion **** 08-06 23:26:40.180: I/ActivityStack(205): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=com.amazon.sample.iap.entitlement cmp=com.amazon.sample.iap.entitlement/.MainActivity} from pid 533 08-06 23:26:40.180: V/ActivityStack(205): Prepare open transition: starting ActivityRecord{419875a8 com.amazon.sample.iap.entitlement/.MainActivity} 08-06 23:26:40.203: V/ActivityStack(205): Prepare open transition: prev=ActivityRecord{41cae9f0 com.amazon.kindle.otter/.activities.AppsLibraryActivity} 08-06 23:26:40.258: D/dalvikvm(7477): GC_CONCURRENT freed 245K, 4% free 11209K/11591K, paused 2ms+2ms 08-06 23:26:40.258: D/SampleIAPEntitlementsApp(7477): onCreate: registering PurchasingListener 08-06 23:26:40.258: D/d(7477): In App Purchasing SDK - Sandbox Mode: PurchasingListener registered: com.amazon.sample.iap.entitlement.SamplePurchasingListener@416014a0 08-06 23:26:40.258: D/d(7477): In App Purchasing SDK - Sandbox Mode: PurchasingListener Context: android.app.Application@415d9408 08-06 23:26:40.258: D/SampleIAPEntitlementsApp(7477): onStart: call getProductData for skus: [Lcom.amazon.sample.iap.entitlement.MySku;@41602820 08-06 23:26:40.258: D/c(7477): In App Purchasing SDK - Sandbox Mode: sendItemDataRequest 08-06 23:26:40.266: D/SampleIAPEntitlementsApp(7477): onResume: call getUserData 08-06 23:26:40.266: D/c(7477): In App Purchasing SDK - Sandbox Mode: sendGetUserDataRequest 08-06 23:26:40.274: D/SampleIAPEntitlementsApp(7477): onResume: getPurchaseUpdates 08-06 23:26:40.274: D/c(7477): In App Purchasing SDK - Sandbox Mode: sendPurchaseUpdatesRequest/sendGetUserData first:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:0:0ad4494d-c21a-4298-936b-8350c83ad83e 08-06 23:26:40.375: D/c(7477): In App Purchasing SDK - Sandbox Mode: handleResponse 08-06 23:26:40.445: W/InputManagerService(205): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41a6c930 (uid=32020 pid=14000) 08-06 23:26:40.461: D/SampleIAPEntitlementsApp(7477): onProductDataResponse: RequestStatus (SUCCESSFUL) 08-06 23:26:40.461: D/SampleIAPEntitlementsApp(7477): onProductDataResponse: successful. The item data map in this response includes the valid SKUs 08-06 23:26:40.461: D/SampleIAPEntitlementsApp(7477): onProductDataResponse: 0 unavailable skus 08-06 23:26:40.461: I/ActivityManager(205): Displayed com.amazon.sample.iap.entitlement/.MainActivity: +259ms 08-06 23:26:40.461: I/logging(7477): Product is not available 08-06 23:26:40.461: D/c(7477): In App Purchasing SDK - Sandbox Mode: handleResponse 08-06 23:26:40.461: I/logging(7477): disableLevel2InView 08-06 23:26:40.477: D/SampleIAPEntitlementsApp(7477): onGetUserDataResponse: requestId (57d69b21-c24a-4d1e-b206-7cf97f4c4e66) userIdRequestStatus: SUCCESSFUL) 08-06 23:26:40.477: D/SampleIAPEntitlementsApp(7477): onUserDataResponse: get user id (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=, marketplace (US) 08-06 23:26:40.477: D/SampleIAPManager(7477): getEntitlementRecordBySku: userId (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=), sku (com.amazon.sample.iap.entitlement.level2) 08-06 23:26:40.477: D/SampleIAPManager(7477): getEntitlementRecordBySku: found 08-06 23:26:40.477: I/logging(7477): Product is not available 08-06 23:26:40.477: D/c(7477): In App Purchasing SDK - Sandbox Mode: handleResponse 08-06 23:26:40.477: I/c(7477): sendGetPurchaseUpdates with user idl3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU= 08-06 23:26:40.477: I/c(7477): send PurchaseUpdates with user id:l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=;reset flag:false, local cursor:1407008408526, parsed from old requestId:GET_USER_ID_FOR_PURCHASE_UPDATES_PREFIX:0:0ad4494d-c21a-4298-936b-8350c83ad83e 08-06 23:26:40.492: I/logging(7477): disableLevel2InView 08-06 23:26:40.555: D/dalvikvm(205): GC_CONCURRENT freed 1667K, 35% free 17765K/27143K, paused 5ms+8ms 08-06 23:26:40.563: D/c(7477): In App Purchasing SDK - Sandbox Mode: handleResponse 08-06 23:26:40.563: I/c(7477): Offset for PurchaseUpdatesResponse:1407008408526 08-06 23:26:40.563: D/SampleIAPEntitlementsApp(7477): onPurchaseUpdatesResponse: requestId (85c8f6df-8636-4bd7-8f74-9b6caccaf392) purchaseUpdatesResponseStatus (SUCCESSFUL) userId (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=) 08-06 23:26:40.563: D/SampleIAPManager(7477): getEntitlementRecordBySku: userId (l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=), sku (com.amazon.sample.iap.entitlement.level2) 08-06 23:26:40.563: D/SampleIAPManager(7477): getEntitlementRecordBySku: found 08-06 23:26:40.563: I/logging(7477): Product is not available 08-06 23:26:40.563: I/logging(7477): disableLevel2InView 08-06 23:26:41.430: V/Sensors(205): accel data: 0.764011 -0.323328 9.793235 08-06 23:26:41.570: I/Sensors(205): **** Motion **** 08-06 23:26:43.953: V/ActivityStack(205): Prepare close transition: finishing ActivityRecord{419875a8 com.amazon.sample.iap.entitlement/.MainActivity} 08-06 23:26:43.961: V/ActivityStack(205): Prepare close transition: prev=ActivityRecord{419875a8 com.amazon.sample.iap.entitlement/.MainActivity} 08-06 23:26:44.078: V/PhoneStatusBar(297): setLightsOn(true) 08-06 23:26:44.274: D/OpenGLRenderer(7477): Flushing caches (mode 0) 08-06 23:26:44.399: D/OpenGLRenderer(7477): Flushing caches (mode 1) 08-06 23:26:46.352: V/Sensors(205): accel data: 0.699346 -0.383203 9.608818 08-06 23:26:48.547: I/ActivityManager(205): No longer want com.svox.pico (pid 7309): hidden #16 08-06 23:26:51.274: V/Sensors(205): accel data: 0.658630 -0.320933 9.651929 08-06 23:26:53.805: I/Sensors(205): **** No Motion **** 08-06 23:26:56.195: V/Sensors(205): accel data: 0.689766 -0.390388 9.685459
10 |2000 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.

Eric@Amazon avatar image
Eric@Amazon answered ·
Hi robin, Thanks for the feedback :) Can you check the following settings in App Tester? 1. Launch Amazon App Tester 2. Select In-App Purchasing API > 2. API Response Settings 3. Ensure "Default" is selected for all 4 API options I suspect "SUCCESSFUL" was selected for the GetProductData API, which would cause App Tester to ignore the content of the .json file and return the selected value. So when onProductDataResponse is called on the sample app, it's status would be successful, but the buy button would not light up because the list of available SKUs is empty (since it ignored the .json file). Thanks
10 |2000 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.

robin avatar image
robin answered ·
Although I had previously launched the new AAT, I had not made changes or selected any options. After a bit of testing, I'll think you'll agree that, making selections there isn't what is causing the SDK sample button to stay un-hilited. and, your assumption was correct, 'Successful' was selected. But not by me. so I Uncheked 'Successful' and set to 'Default' Now the SDK Entitlement app is rendering Buy Access to Level 2 button still continues to be un-hilited Level 2 Enabled label background is now in yellow Status: 'Product is available and already purchased' The strange part: How could this show 'already purchased' when the button has always been hilit and unselectable? (therefore I could never have made a purchase attempt) I cleared the app data using the totally awesome instructions previously given ;-) I set the AAT selection back to 'Succuessful', re-ran the app and it does as expected, return to greyed out and button un-hilit state along with 'Product is not available' I cleared the app data yet again, verifying the AAT has four 'default' settings indicated, but the SDK sample still loads with the button greyed out in an un-selectable state. I could still try peppering the code with more log statements. Other ideas? Send me a KF HDX 9 to see if it is hardware related? Q: During the AAT testing phase, dose the SDK app or AAT make requests out to the AWS web service servers to perform authentication-verification causing data on the cloud server to somehow corrupt the app launch settings?
10 |2000 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.

Eric@Amazon avatar image
Eric@Amazon answered ·
Hi robin, There are 2 conditions required in order for the buy button to light up in this sample app. 1. The IAP item is defined in the .json file 2. The IAP item has not been purchased before After you changed the API options to "Default", you saw the label with a yellow background, and the buy button remain disabled. That is expected due to condition #2 above. The reason is that, for entitlement, user can only purchase the item once. So the app should check the purchase status and prevent the user from purchasing the same item again. https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/types-of-purchases I believe the following steps should get you un-blocked: 1. Launch Amazon App Tester 2. Verify again "Default" is selected for all 4 API options 3. Select 3. Manage Transactions 4. Select Delete All 5. Force-close and clear app data of the sample app That should reset everything back to default. Regarding your last question, both the sample app and Amazon App Tester do not require Internet connection to operate. Testing can be done completely offline. Thanks
10 |2000 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.

robin avatar image
robin answered ·
Good guess, but that wasn't it. . . . I do however have a few ideas. Quick recap: I purchased KF HD7 2nd around Nov 2013. OS 7.4.6? Started IAP v1.03 in Jan 2014. Never got SDK entitlements to work and some process corrupted device. First level Amazon support insisted I do a factory reset, despite pleas concerning all the current development would be lost. Against my wishes, did the reset and all development did get whacked along with all my Silk settings. Rats! [insert better actual expletive] This time got the IAP v1.03 SDK consumable to work. Put it aside to explore WebApps instead. https://forums.developer.amazon.com/forums/thread.jspa?messageID=6270᡾ On going struggles with WebApps see forum under my name, then on to explore and live with limitations with Html5 hybrid apps. Again see hybrid forum. I also remember that when I worked with Html5 localStorage from an Android WebView, that sometimes the entire store would become corrupt when testing with WAT v1 but I believe that was to have been fixed with WAT v2 2014.06.27 which is what I have installed now. https://forums.developer.amazon.com/forums/thread.jspa?messageID=7558ᶆ https://forums.developer.amazon.com/forums/message.jspa?messageID=11491#11560 https://forums.developer.amazon.com/forums/thread.jspa?messageID=7541ᵵ Ponder: Does IAP use the same method (Java) to store (file API maybe?) it's local storage similarly to how WAT stores (Java) the Android WebView (Html) window.localStorage? e.g. if so, could the Kindle local store be corrupt? and is there a way to test, as from these post responses, one is unable to view what data is there. In July 2014 saw post that IAP v1.03 was deprecated so attempted to see what surprises would now pop up as KF HD7 now at OS 7.4.9 and hybrid app close to submittal phase. Kept getting JSON error: No value for priceJson Performed the uninstall SDK v1 re-install as specified by link in opening post in this thread http://forums.developer.amazon.com/forums/thread.jspa?threadID=3787&tstart=0 Then kept getting the Null pointer exception, to which I started this thread. After reading your last post, and as I had never played with the new version 2, and after last week checking in SDK v1 tester noticed there weren't any transaction at all. Bewildered, as I expected to see the consumable as I had 'upgraded' (compiled new proj) the SDK v2 consumable source as a new project. on a hunch, I checked AAT v2 'Managed Transactions' but only the consumable that I had created last week was there. So, now the big question. As you were convinced that there were only two possible alternatives, and deduced that the second would have to be the logical choice, and in response that the AWS servers are not involved (why I asked the question in the first place) data has to be created and stored within the Kindle memory space. So, . . . Why isn't the entitlement transaction shown in the new AAT v2 ? Launching either app button continues to be un-hlited as the suggestion is that both my app and the debug app made available performed identical, could/does means both were detecting the 'entitlement' transaction despite the fact it wasn't to be seen. [*** Incidentally, I also remember this was an additional source of issues the front line support team was unable to answer back in Jan 2014 - why certain things weren't showing up and also brings to mind the myriad of complaints over the last six months of individuals performing installs yet their icons now showing up, sideloaded app files not visible using ES3 and such. Seems the KF HD 2nd is problematic here] https://forums.developer.amazon.com/forums/thread.jspa?messageID=6490ᥚ My hunches: Corrupt data that infected the memory space of the new AAT during install as I no longer get the 'JSON error: No value for priceJson' after performing the un-install of SDK v1 Shared memory space of AAT v2 and SDK v1 that isn't properly cleared during install? SDK v2 samples containing classes whose instances access shared data space of the older v1 samples? Not sure if the new AAT had a recent upgrade as I didn't check the version until you requested me do so. I double checked to make sure no transactions appeared under SDK v1 'Active Transactions' and only the one consumable transaction was visible under the 'Managed Transactions' of AAT v2, I cleared data from each under more >> settings >> applications >> running apps and then reviewed, but had the same un-hilit button. Unless there are other ideas the team would like me to test, I would like to uninstall both testers and if needed both .apk's. and, no . . . I'm not prepared to perform a factory reset for reasons stated above. But you weren't going to ask me to do that anyway. Right?! Q: Is it possible/advisable to run IAP v1.03 tests using the new AAT v2 tester? Robin
10 |2000 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.