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