question

newuser-ef06051c-7aa1-4dd5-bc43-5bdac6ef77d6 avatar image

IAP in Live App Testing gives error

Hi, I am implementing IAP in my app. I am using sample that comes in Amazon SDK for inAppPurchase. In local i am using app tester and its working fine but its not working with Live App testing. giving some error. I have already created in app item on Amazon portal. Below is the error which i am facing -

javax.crypto.IllegalBlockSizeException: last block incomplete in decryption

at com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(BaseBlockCipher.java:1104)

at javax.crypto.Cipher.doFinal(Cipher.java:2056)

at com.amazon.mas.client.util.encryption.SimpleObfuscator.deobfuscate(SimpleObfuscator.java:381)

at com.amazon.mas.client.util.encryption.SimpleObfuscator.deobfuscate(SimpleObfuscator.java:120)

at com.amazon.mas.client.iap.datastore.IAPCheckpointTable.getCheckpoint(IAPCheckpointTable.java:167)

at com.amazon.mas.client.iap.datastore.IAPDataStoreImpl.getCheckpoint(IAPDataStoreImpl.java:346)

at com.amazon.mas.client.iap.subscription.SubscriptionsManagerImpl.sync(SubscriptionsManagerImpl.java:184)

at com.amazon.mas.client.iap.purchasehistory.PurchaseHistoryManagerImpl$3.run(PurchaseHistoryManagerImpl.java:169)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)

at java.lang.Thread.run(Thread.java:761)


iaplive app testing
10 |5000

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

Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

It sounds like a configuration problem, possibly ProGuard or another code obfuscator (such as the new R8 in the latest Android Studio) interfering and stripping parts of your code as you export your app for release.

To test that, please either disable ProGuard / R8 before you upload the next beta version to Live App Testing, or configure it to exclude / ignore certain classes, and see if IAP works for you. For that, please see this article on how to configure ProGuard for Amazon IAP: https://developer.amazon.com/docs/in-app-purchasing/iap-obfuscate-the-code.html -- thanks!

6 comments
10 |5000

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

@Levon@Amazon Thanks for your answer. I did that but still facing the issue. Please have a look below attached screenshot. https://drive.google.com/open?id=1R19L7bqOM8xG9YbvfOCpLMyaiAIKOft1 also have a look to below logs - https://drive.google.com/open?id=18opn5cSR-R-UTZxoIJ-iQfFq89zsbHdT

1 Like 1 ·
newuser-ef06051c-7aa1-4dd5-bc43-5bdac6ef77d6 avatar image newuser-ef06051c-7aa1-4dd5-bc43-5bdac6ef77d6 newuser-69388ee6-68a8-4f23-97d8-08195ed03ea0 ·

I am still facing the issue in IAP. Please have a look to below logs -


https://docs.google.com/document/d/18f4IcSEGOvB-3D2ZFuPHC2KfOL-aU_G44aHKuHLGsh4/edit?usp=sharing


Please help me , I am stuck at this point.

2 Likes 2 ·
newuser-a1e66e9a-df0f-4a34-8428-946459a493c8 avatar image newuser-a1e66e9a-df0f-4a34-8428-946459a493c8 newuser-ef06051c-7aa1-4dd5-bc43-5bdac6ef77d6 ·

Hey, I am having the same issue, how did you solve it?

0 Likes 0 ·
Show more comments
newuser-ef06051c-7aa1-4dd5-bc43-5bdac6ef77d6 avatar image
newuser-ef06051c-7aa1-4dd5-bc43-5bdac6ef77d6 answered

@Levon@Amazon Thanks for your answer. I did that but still facing the issue. Please have a look below attached screenshot. https://drive.google.com/open?id=1R19L7bqOM8xG9YbvfOCpLMyaiAIKOft1 also have a look to below logs - https://drive.google.com/open?id=18opn5cSR-R-UTZxoIJ-iQfFq89zsbHdT

10 |5000

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

newuser-a1e66e9a-df0f-4a34-8428-946459a493c8 avatar image
newuser-a1e66e9a-df0f-4a34-8428-946459a493c8 answered

The issue happening turned out to be from Amazon LAT not working saying "An error occurred while processing your purchase" -> An error occurred while attempting to purchase this item please try again."


When I uploaded same code to production it worked!

10 |5000

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

WhiteXmasBone avatar image
WhiteXmasBone answered

So the solution is to simply ignore LAT and just try production? :-)

10 |5000

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

newuser-94224243-d73d-44a4-867a-b7507db26cef avatar image
newuser-94224243-d73d-44a4-867a-b7507db26cef answered

any solution

10 |5000

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

newuser-94224243-d73d-44a4-867a-b7507db26cef avatar image
newuser-94224243-d73d-44a4-867a-b7507db26cef answered

can anyone briefly explain solution to this problem ! ?????

10 |5000

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

newuser-def31457-c9b3-4fed-85a5-234cc41df4a1 avatar image
newuser-def31457-c9b3-4fed-85a5-234cc41df4a1 answered

Hi ,

I am also getting same issue in LAT
screen short:here

and log :here

10 |5000

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