Skip to content

fix: add ProGuard rules to prevent 3D Secure crash#2320

Merged
remonh87 merged 1 commit into
flutter-stripe:mainfrom
realmeylisdev:fix/3d-secure-proguard-crash
Feb 3, 2026
Merged

fix: add ProGuard rules to prevent 3D Secure crash#2320
remonh87 merged 1 commit into
flutter-stripe:mainfrom
realmeylisdev:fix/3d-secure-proguard-crash

Conversation

@realmeylisdev

Copy link
Copy Markdown
Contributor

Summary

  • Add comprehensive ProGuard/R8 rules to the library's consumer rules to prevent PaymentFlowResult$Unvalidated$Companion from being stripped during minification
  • This fixes the crash that occurs after completing 3D Secure authentication on Android

Problem

When using payment methods that require 3D Secure authentication (mandatory for many cards in EU/UK), the app crashes after the WebView closes with:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/stripe/android/payments/PaymentFlowResult$Unvalidated$Companion;

This happens because the library's proguard-rules.txt (distributed via consumerProguardFiles) was missing the critical -keep class com.stripe.** { *; } rule, allowing R8/ProGuard to strip essential Stripe payment flow classes.

Solution

Enhanced packages/stripe_android/android/proguard-rules.txt to include:

  • -keep class com.stripe.** { *; } - Keeps all Stripe classes
  • All -dontwarn rules for push provisioning and kotlinx.parcelize

These rules are now automatically applied to consuming apps via consumerProguardFiles, so users no longer need to manually add them.

Fixes #2221

Test plan

  • Build a release APK with minification enabled
  • Test payment with a 3D Secure card (e.g., 4000 0027 6000 3184)
  • Verify no crash occurs after completing 3D Secure authentication

Add comprehensive ProGuard/R8 rules to the library's consumer rules
to prevent PaymentFlowResult$Unvalidated$Companion from being stripped
during minification. This fixes the crash that occurs after completing
3D Secure authentication on Android.

Fixes flutter-stripe#2221

@remonh87 remonh87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@remonh87 remonh87 merged commit ec035ae into flutter-stripe:main Feb 3, 2026
2 of 5 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.

Crash on 3D Secure

2 participants