NoClassDefFoundError in BillingFlowParams
- [X] I have updated Purchases SDK to the latest version
- [X] I have read the Contribution Guidelines
- [X] I have searched the Community
- [X] I have read docs.revenuecat.com
- [X] I have searched for existing Github issues
Environment
- [X] Output of
flutter doctor
[✓] Flutter (Channel stable, 3.27.2, on macOS 15.1.1 24B91 darwin-arm64, locale en-PL)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 1 category.
- [X] Version of
purchases-flutter8.4.4 - [X] Testing device version: Vivo Y53, Alcatel Tab Mini 7, Wind River A37; Android 6, Android 5
- [X] How often the issue occurs? On production, I updated 2 days ago and got 3 reports already. Definitely doesn't happen to everyone, but it didn't happen ever before.
- [X] Stacktrace
Fatal Exception: java.lang.NoClassDefFoundError: o1.j0
at com.android.billingclient.api.BillingFlowParams$Builder.build(com.android.billingclient:billing@@7.1.1:1)
at com.revenuecat.purchases.google.BillingWrapper.buildOneTimePurchaseParams(BillingWrapper.kt)
at com.revenuecat.purchases.google.BillingWrapper.buildPurchaseParams(BillingWrapper.kt)
at com.revenuecat.purchases.google.BillingWrapper.access$buildPurchaseParams(BillingWrapper.kt)
at com.revenuecat.purchases.google.BillingWrapper$makePurchaseAsync$2.invoke(BillingWrapper.kt:2)
at com.revenuecat.purchases.google.BillingWrapper$makePurchaseAsync$2.invoke(BillingWrapper.kt:1)
at com.revenuecat.purchases.google.BillingWrapper.executePendingRequests$lambda$3$lambda$2$lambda$1(BillingWrapper.kt:7)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:5911)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879)
- [X] Steps to reproduce:
I don't know how to reproduce it, it works fine on my Pixel. However, since it didn't happen before, I'm guessing it could be easy for you to dissect difference between libraries versions.
I recently upgraded from
8.2.2to8.4.4
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi @PawlikMichal25 - just to confirm, you can't reproduce this at all on your Pixel with a release build?
Can you share a list of your dependencies by running:
./gradlew :app:dependencies
where app is the name of your app’s Gradle module?
Yes, I mean I tested basic use cases on my Pixel 3 and they worked fine.
Output of running the command in file: log.txt
Thank you for the logs. Can you now use retrace to deobfuscate this so we can learn what the o1.j0 class is that can't be found? You should be able to use the mapping file of the exact version that the stack trace occurred in. You can find this on the Play Console:
- Test and release -> App bundle explorer
- Select the same version as the one the stack trace occurred in.
- Downloads -> Download the original file
- Replace the .aab extension with .zip and extract
- Find the mapping file in BUNDLE-METADATA/com.android.tools.build.obfuscation.
Same issue, is there a solution?
@wnoiokjfwa Can you provide the files requested in this issue so we can investigate? Please follow this comment and this comment. Thanks.
Hi @PawlikMichal25 and @wnoiokjfwa, we investigated this issue and it is caused by the Play Billing Library. This is reported to Google here:
- https://issuetracker.google.com/issues/377466571
- https://issuetracker.google.com/issues/404645683
The Play Billing Library started using certain Java 8 types, which not all devices can handle.
Until they fix this, the only workaround is to enable Core Library Desugaring in your Android app. To do so, you can follow the instructions here. Let us know if you have more questions!
Hey all!
Going ahead and closing this - but feel free to reopen/reach out at any point if there's any follow up.
Thanks for reporting!