Describe the bug
Android release builds (flutter build appbundle --release or flutter build apk --release) fail during the R8 minification step (:app:minifyReleaseWithR8). The error indicates missing com.stripe.android.pushProvisioning.* classes, which are apparently referenced by internal classes named similarly to com.reactnativestripesdk.*.
To Reproduce
Steps to reproduce the behavior:
- Create a Flutter project using Flutter version 3.29.3.
- Add
flutter_stripe: ^11.5.0 (or ^11.0.0, issue occurred with both) to pubspec.yaml.
- Configure the Android project for release builds (ensure
isMinifyEnabled = true in app/build.gradle.kts).
- Run
flutter build appbundle --release.
Expected behavior
The release build should complete successfully.
Actual behavior
The build fails with the following R8 error:
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /path/to/your/project/build/app/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class com.stripe.android.pushProvisioning.PushProvisioningActivity$g (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
Missing class com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider) and 1 other context)
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:minifyReleaseWithR8'.
A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
Compilation failed to complete
Screenshots
(Optional: You can attach screenshots if they add specific context, but the error log is usually most important).
Environment:
- Flutter version: 3.29.3, channel stable
- Dart version: 3.7.2
- OS: macOS 15.4.1 darwin-arm64
flutter_stripe version: Tested with ^11.5.0 and ^11.0.0 (both failed)
- Android Gradle Plugin (AGP) version: Tested with
8.7.0 and 8.5.0 (both failed)
- Gradle version: Tested with
8.10.2 and 8.8 (both failed)
- Kotlin Gradle Plugin version: Tested with
2.1.20 and 2.0.0 (both failed)
- JDK version: OpenJDK 21.0.6 (Bundled with Android Studio 2024.3)
(Optional but helpful) Output of flutter doctor -v:
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.4.1 24E263 darwin-arm64, locale en-US)
• Flutter version 3.29.3 on channel stable at /Users/arqsabra/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ea121f8859 (3 weeks ago), 2025-04-11 19:10:07 +0000
• Engine revision cf56914b32
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
• Android SDK at /Users/arqsabra/Library/Android/sdk
• Platform android-36, build-tools 36.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
[✓] VS Code (version 1.98.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.108.0
[✓] Connected device (4 available)
• Yoyo (wireless) (mobile) • 00008130-0011516421A0001C • ios • iOS 18.4 22E240
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4.1 24E263 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.4.1 24E263 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.166
[✓] Network resources
• All expected network resources are available.
• No issues found!
Additional context
- The build succeeds if
isMinifyEnabled = false is set in android/app/build.gradle.kts.
- Adding specific Proguard rules for the missing
pushProvisioning classes did not resolve the issue.
- Adding the broad rule
-keep class com.stripe.** { *; } alone did not resolve the issue.
- The build only succeeds with R8 enabled when the following rules are added to
android/app/proguard-rules.pro:
-keep class com.stripe.** { *; }
-dontwarn com.reactnativestripesdk.**
This suggests R8 might be getting confused by internal references within the Stripe SDK/plugin that are named similarly to React Native components, requiring both the broad keep rule and the dontwarn rule to function.
The presence of ios/.symlinks/plugins/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/ReactNativeCustomerAdapter.swift was noted in the iOS plugin code, supporting the idea of internal React Native naming/structures.
Describe the bug
Android release builds (
flutter build appbundle --releaseorflutter build apk --release) fail during the R8 minification step (:app:minifyReleaseWithR8). The error indicates missingcom.stripe.android.pushProvisioning.*classes, which are apparently referenced by internal classes named similarly tocom.reactnativestripesdk.*.To Reproduce
Steps to reproduce the behavior:
flutter_stripe: ^11.5.0(or^11.0.0, issue occurred with both) topubspec.yaml.isMinifyEnabled = trueinapp/build.gradle.kts).flutter build appbundle --release.Expected behavior
The release build should complete successfully.
Actual behavior
The build fails with the following R8 error:
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /path/to/your/project/build/app/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class com.stripe.android.pushProvisioning.PushProvisioningActivity$g (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
Missing class com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider) and 1 other context)
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:minifyReleaseWithR8'.
A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
Compilation failed to complete
Screenshots
(Optional: You can attach screenshots if they add specific context, but the error log is usually most important).
Environment:
flutter_stripeversion: Tested with^11.5.0and^11.0.0(both failed)8.7.0and8.5.0(both failed)8.10.2and8.8(both failed)2.1.20and2.0.0(both failed)(Optional but helpful) Output of
flutter doctor -v:[✓] Flutter (Channel stable, 3.29.3, on macOS 15.4.1 24E263 darwin-arm64, locale en-US)
• Flutter version 3.29.3 on channel stable at /Users/arqsabra/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ea121f8859 (3 weeks ago), 2025-04-11 19:10:07 +0000
• Engine revision cf56914b32
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
• Android SDK at /Users/arqsabra/Library/Android/sdk
• Platform android-36, build-tools 36.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
[✓] VS Code (version 1.98.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.108.0
[✓] Connected device (4 available)
• Yoyo (wireless) (mobile) • 00008130-0011516421A0001C • ios • iOS 18.4 22E240
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4.1 24E263 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.4.1 24E263 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.166
[✓] Network resources
• All expected network resources are available.
• No issues found!
Additional context
isMinifyEnabled = falseis set inandroid/app/build.gradle.kts.pushProvisioningclasses did not resolve the issue.-keep class com.stripe.** { *; }alone did not resolve the issue.android/app/proguard-rules.pro:This suggests R8 might be getting confused by internal references within the Stripe SDK/plugin that are named similarly to React Native components, requiring both the broad keep rule and the dontwarn rule to function.
The presence of ios/.symlinks/plugins/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/ReactNativeCustomerAdapter.swift was noted in the iOS plugin code, supporting the idea of internal React Native naming/structures.