After building and deploying to an Android device, I get this error.
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/vending/billing/IInAppBillingService$Stub;
at com.unity.purchasing.googleplay.BillingServiceManager$1$2.run(BillingServiceManager.java:85)
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:762)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.android.vending.billing.IInAppBillingService$Stub” on path: DexPathList[[zip file “/data/app/com…/base.apk”],nativeLibraryDirectories=[/data/app/com…/lib/arm64, /data/app/com…/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.unity.purchasing.googleplay.BillingServiceManager$1$2.run(BillingServiceManager.java:85)
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:762)
Even though this is over a year old I now have that error with IAP version 2.2.2 (newest in package manager) on Unity 2018.4.36f1 with Google’s Billing Library v3 (which is a requirement soon). Does this mean I have to update the used Unity version in order to get IAP working again?
According to Google just using IAP 2.2.2 is not enough and updates will be blocked soon as it isn’t using Billing Library v3. Hence the include of their package which should work along Unity’s IAP. Which then gives the error message seen above (-> IAP not working, app crashing).
Google has been known to inspect all uploaded binaries, not just the most recent one. So any binaries in test tracks. You can use Analyze APK… in Android Studio to confirm the library versions.
Even without any other binaries, uploading an app with IAP 2.2.2 and without Google’s Billing Library v3 as extra package, Google states that it is not enough and doesn’t use v3 and won’t be accepted soon anymore.
2.2.2 already has GPBL v3, did you confirm with APK Analyze as suggested? I would recommend you do this, and show it to Google! Unity 2018 is no longer supported, are you able to upgrade? The latest IAP is 4.0.0, you are using an old version.
Yes, I did and it doesn’t include GPBL v3. According to the package manager (and the Asset store) the newest IAP for 2018 is 2.2.2. Updating to a newer Unity version might be an option but as many platforms are affected that should be the last resort. Still a few months to go till that will be a problem…
Can you confirm which Asset version you have and Package Manager version for In App Purchasing library you have? We have no plans to back port any further IAP updates to Unity 2018