-
Couldn't load subscription status.
- Fork 694
Description
Description
We are experiencing multiple runtime crashes originating from Stripe Android SDK activities (PaymentSheet, PollingActivity, CvcRecollectionActivity, CardScanActivity, PaymentMethodsActivity, and ChallengeActivity).
All crashes occur during the onCreate() lifecycle of Stripe components, typically before any user interaction. The most common error patterns are:
- java.lang.IllegalArgumentException: Required value was null.
- java.lang.IllegalStateException: Cannot start CVC Recollection flow without args.
- java.lang.IllegalStateException: PaymentConfiguration was not initialized. Call PaymentConfiguration.init().
It seems that some internal activities of the SDK expect required arguments that are not properly validated, or they are launched before the SDK is fully initialized. These crashes occur sporadically in production, even though we ensure that PaymentConfiguration.init(context, publishableKey) is always called in the Application.onCreate() before any Stripe usage.
Crash Examples
Fatal Exception: java.lang.IllegalArgumentException
Required value was null.
com.stripe.android.paymentsheet.paymentdatacollection.polling.PollingActivity$args$2.invoke (PollingActivity.kt:27)
Fatal Exception: java.lang.IllegalStateException
Cannot start CVC Recollection flow without args
com.stripe.android.paymentsheet.paymentdatacollection.cvcrecollection.CvcRecollectionActivity$args$2.invoke (CvcRecollectionActivity.kt:20)
Fatal Exception: java.lang.IllegalStateException
PaymentConfiguration was not initialized. Call PaymentConfiguration.init().
com.stripe.android.ui.core.cardscan.CardScanActivity.onCreate (CardScanActivity.kt:23)
Fatal Exception: java.lang.IllegalArgumentException
Required value was null.
com.stripe.android.view.PaymentMethodsActivityStarter$Args$Companion.create$payments_core_release (PaymentMethodsActivityStarter.kt:176)
Fatal Exception: java.lang.IllegalArgumentException
Required value was null.
com.stripe.android.stripe3ds2.views.ChallengeViewArgs$Companion.create (ChallengeViewArgs.kt:35)
Expected behavior:
Stripe SDK activities should gracefully handle missing or invalid arguments and provide explicit developer errors or fail silently — not throw IllegalArgumentException or IllegalStateException.
Stripe SDK version: 20.53.0
Android: Various Android 11
Crashes reported via Firebase Crashlytics