Skip to content

fix(android): suppress R8 warnings for optional push provisioning classes - #2715

Merged
cttsai-stripe merged 1 commit into
stripe:masterfrom
1kuko3:fix-push-provisioning-r8-dontwarn
Oct 7, 2026
Merged

cttsai-stripe merged 1 commit into
stripe:masterfrom
1kuko3:fix-push-provisioning-r8-dontwarn

Conversation

@1kuko3

@1kuko3 1kuko3 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Add -dontwarn com.stripe.android.pushProvisioning.** to the library's consumer ProGuard rules (android/proguard-rules.txt), next to the existing -dontwarn for TapAndPay.

Motivation

Fixes #1700.

com.stripe:stripe-android-issuing-push-provisioning is a compileOnly dependency. As android/build.gradle notes, apps add it themselves only when they use push provisioning. The SDK's pushprovisioning package still references its classes, so any app that enables R8 without that dependency fails :app:minifyReleaseWithR8:

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in .../missing_rules.txt.
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivity$g (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(...))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(...))

The code is already built for these classes to be missing: PushProvisioningProxy checks for them with Class.forName before use and logs instead of crashing. R8 doesn't know that, so each app currently has to add this rule itself, as the workarounds in #1700 show. This matters more now that the Expo SDK 58 template enables R8 for release builds by default.

Apps that do include push provisioning are unaffected: their classes are present, and the existing -keepclassmembers rule for com.stripe.android.pushProvisioning.** still applies.

Testing

  • I tested this manually
  • I added automated tests

In our Expo SDK 58 app (React Native 0.88, AGP 9.2.1, Gradle 9.4.1, @stripe/stripe-react-native 0.63.0, push provisioning dependency not installed):

  • without the rule, :app:minifyReleaseWithR8 fails with the missing-class errors above;
  • with this rule added only to the library's proguard-rules.txt and no app-level rule, :app:minifyReleaseWithR8 passes, and the R8 mapping contains no com.stripe.android.pushProvisioning classes.

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

…sses

Co-authored-by: Cursor <cursoragent@cursor.com>

@cttsai-stripe cttsai-stripe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cttsai-stripe
cttsai-stripe merged commit 67cef44 into stripe:master Oct 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: R8 Minifying missing classes ERROR

2 participants