Skip to content

NoClassDefFoundError in BillingFlowParams #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
11 tasks done
PawlikMichal25 opened this issue Feb 4, 2025 · 7 comments
Open
11 tasks done

NoClassDefFoundError in BillingFlowParams #1255

PawlikMichal25 opened this issue Feb 4, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@PawlikMichal25
Copy link

Environment

  • 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.
  • Version of purchases-flutter
    8.4.4
  • Testing device version:
    Vivo Y53, Alcatel Tab Mini 7, Wind River A37; Android 6, Android 5
  • 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.
  • 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)
  • 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.2 to 8.4.4
@PawlikMichal25 PawlikMichal25 added the bug Something isn't working label Feb 4, 2025
@RCGitBot
Copy link
Contributor

RCGitBot commented Feb 4, 2025

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@Jethro87
Copy link
Contributor

Jethro87 commented Feb 7, 2025

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?

@PawlikMichal25
Copy link
Author

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

@Jethro87
Copy link
Contributor

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:

  1. Test and release -> App bundle explorer
  2. Select the same version as the one the stack trace occurred in.
  3. Downloads -> Download the original file
  4. Replace the .aab extension with .zip and extract
  5. Find the mapping file in BUNDLE-METADATA/com.android.tools.build.obfuscation.

@wnoiokjfwa
Copy link

Same issue, is there a solution?

@Jethro87
Copy link
Contributor

Jethro87 commented Mar 7, 2025

@wnoiokjfwa Can you provide the files requested in this issue so we can investigate? Please follow this comment and this comment. Thanks.

@JayShortway
Copy link
Member

Hi @PawlikMichal25 and @wnoiokjfwa, we investigated this issue and it is caused by the Play Billing Library. This is reported to Google here:

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants