gpt4 book ai didi

java - 购买成功,但解码时出现 "Class not found": com. google.android.finsky.billing.lightpurchase.PurchaseParams

转载 作者:行者123 更新时间:2023-12-04 23:35:36 25 4
gpt4 key购买 nike

我的适配器中有一个带有应用内计费的应用程序(要购买的项目列表)。我在测试应用内计费时遇到问题。
一切正常 - 用户能够完成整个购买过程。 “购买成功”会显示在购买流程的末尾,并且会向用户发送一封电子邮件以确认他们的购买。
但是,该项目似乎没有被消耗,并且没有调用我将项目添加到用户的服务器调用。检查日志后,我看到了这个错误

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

最佳答案

如果 this issue is correct,这个问题一直在 stackoverflow 中出现。它与一些错误的反射有关,当代码中的参数为空时,它会尝试加载不存在的类

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


因此,在调用该方法之前,请确保有效负载不为空。

关于java - 购买成功,但解码时出现 "Class not found": com. google.android.finsky.billing.lightpurchase.PurchaseParams,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27242746/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com