Successful purchase but has "Class not found" when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams
Asked Answered
W

1

77

I have an app with In-App Billing in its Adapter (list of items to buy). I am having a problem during testing of the in-App Billing.

Everything works fine - The user is able to go through the whole purchase process. "Successful Purchase" is shown at the end of the Purchase Flow and there is an email being sent to the user confirming their purchase.

However, the item does not seem to be consumed and my server call to add the item to the user is not being called. Upon checking the logs, I see this error

12-02 13:04:47.701 29663 29663 D IabHelper: Launching buy intent for xxxxxxxxxxx. Request code: 10001
12-02 13:04:47.701  2450  3128 D EnterpriseDeviceManager: ContainerId: 0
12-02 13:04:47.711  2450  3128 E Parcel  : Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams
12-02 13:04:47.711  2450  3128 E Parcel  : java.lang.ClassNotFoundException: com.google.android.finsky.billing.lightpurchase.PurchaseParams
12-02 13:04:47.711  2450  3128 E Parcel  :  at java.lang.Class.classForName(Native Method)
12-02 13:04:47.711  2450  3128 E Parcel  :  at java.lang.Class.forName(Class.java:251)
12-02 13:04:47.711  2450  3128 E Parcel  :  at java.lang.Class.forName(Class.java:216)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Parcel.readParcelableCreator(Parcel.java:2133)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Parcel.readParcelable(Parcel.java:2097)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Parcel.readValue(Parcel.java:2013)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Parcel.readArrayMapInternal(Parcel.java:2314)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Bundle.unparcel(Bundle.java:249)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Bundle.getString(Bundle.java:1118)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.content.Intent.getStringExtra(Intent.java:5145)
12-02 13:04:47.711  2450  3128 E Parcel  :  at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1467)
12-02 13:04:47.711  2450  3128 E Parcel  :  at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1063)
12-02 13:04:47.711  2450  3128 E Parcel  :  at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:4313)
12-02 13:04:47.711  2450  3128 E Parcel  :  at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254)
12-02 13:04:47.711  2450  3128 E Parcel  :  at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:4194)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:260)
12-02 13:04:47.711  2450  3128 E Parcel  :  at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2645)
12-02 13:04:47.711  2450  3128 E Parcel  :  at android.os.Binder.execTransact(Binder.java:404)
12-02 13:04:47.711  2450  3128 E Parcel  :  at dalvik.system.NativeStart.run(Native Method)
12-02 13:04:47.711  2450  3128 E Parcel  : Caused by: java.lang.NoClassDefFoundError: com/google/android/finsky/billing/lightpurchase/PurchaseParams
12-02 13:04:47.711  2450  3128 E Parcel  :  ... 19 more
12-02 13:04:47.711  2450  3128 E Parcel  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.finsky.billing.lightpurchase.PurchaseParams" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
12-02 13:04:47.711  2450  3128 E Parcel  :  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
12-02 13:04:47.711  2450  3128 E Parcel  :  at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
12-02 13:04:47.711  2450  3128 E Parcel  :  at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
12-02 13:04:47.711  2450  3128 E Parcel  :  ... 19 more
12-02 13:04:47.711  2450  3128 V ApplicationPolicy: isApplicationStateBlocked userId 0 pkgname com.android.vending
Wirework answered 2/12, 2014 at 5:51 Comment(9)
Did you find a solution to this problem? I have the exact same problem, in fact my published version also has this problem. So purchases go through but my OnIabPurchaseFinishedListener is never called, so the purchase is never activated immediately. The funny part is that the purchase is registered on the Google server, so if the user re-opens the app, he can see the purchase.Outrigger
Any luck thus far, MRK?Bugbee
Whenever I create the list of things to buy using the adapter, I go through the items bought but not consumed, and consume it before generating the list. This way, I can assure that all items are consumed whenever the user checks the list. We record the purchased items of the user in our own backend so consuming items does not have much bearing on the items shown to the user.Wirework
I have exactly the same issue. Suddenly it stopped working in all of my published apps which were using the same IAB implementation based in TrivialDrive example.Hermaphrodite
Did anybody find what what went wrong? I've the same issue :(Perchance
Can you please post some of the related code? Is there any place where you passed an object between two activities or as parameters?Affirmation
Try to follow this answer on Stack Overflow: https://mcmap.net/q/179859/-the-item-you-requested-is-not-available-for-purchaseAuburn
How do you expect to get any answers without releasing any code/example? the log is useless without some contextCellaret
isn't this the same case ? #28590009Meyeroff
E
1

This problem has been making the rounds in stackoverflow, if this issue is correct it is related with some wrong reflection that tries to load a class that is not present when a parameter is null in your code

It looks like there may be a race condition between PurchaseAsync and the HandleActivityResult callback. tcsPurchase is being set after the call to serviceConnection.Service.GetBuyIntent which I think allows the HandleActivityResult call happen while tcsPurchase is still null. When I pass an empty string for the "payload", it gets deserialized as null, causing the comparison to fail when checking for success.

So make sure the payload is not null before calling that method.

Extrasensory answered 10/4, 2022 at 6:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.