'AbstractCommandTask: Exception occurred while processing task: com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null

I was using for Amazon In-App Purchases (IAP) in-app-purchasing-2.0.76.jar and switched to com.amazon.device:amazon-appstore-sdk:3.0.2 after their latest update. I followed the instructions provided by Amazon for the migration to AppstoreSDK.

I also followed the updated instructions for AppTester as described here.

But, I receive an Authentication Exception:

D/Kiwi: AbstractCommandTask: Exception occurred while processing task: com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null
    com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null
        at com.amazon.a.a.n.a.b.a(AuthenticationTokenVerifier.java:94)
        at com.amazon.a.a.n.a.a.a(AbstractCommandTask.java:204)
        at com.amazon.a.a.n.a.a.a(AbstractCommandTask.java:131)
        at com.amazon.a.a.n.b.b$1.run(SimpleTaskPipeline.java:179)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.os.HandlerThread.run(HandlerThread.java:65)

Thus, the listener for methods: PurchasingService.getUserData(); and PurchasingService.getPurchaseUpdates(true); is not triggered.

Tried and failed:

  1. Update ProGuard for possible obfuscation in Amazon classes.
  2. Remove V2 signing for debug .apk.
  3. Ensure that I am in Sandbox Mode.
  4. Update AppstoreAuthenticationKey.pem file from Amazon Developer Console.
  5. Update amazon.sdktester.json file from Amazon Developer Console.
  6. Compare existing code with the documentation provided by Amazon.

Note: The exact same implementation with in-app-purchasing-2.0.76.jar was working.

All the above were tested in Amazon Kindle Fire HD 10 tablet running Fire OS 7.3.2.2

Any thoughts?



Solution 1:[1]

As you mention the Amazon App Tester app, I presume you receive the AUTH error during local testing.

If so, check your final merged AndroidManifest.xml contains the receiver tags needed for the Amazon App Tester to respond to your sandbox API requests:

https://developer.amazon.com/docs/in-app-purchasing/iap-implement-iap.html#responsereceiver

I had the same issue using build flavours (one for Google, one for Amazon) and the receiver tags were being ignored in the Amazon manifest.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1