Skip to content
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

Android: 3DS2 crashes #1387

Closed
zdnk opened this issue May 11, 2023 · 16 comments
Closed

Android: 3DS2 crashes #1387

zdnk opened this issue May 11, 2023 · 16 comments

Comments

@zdnk
Copy link

zdnk commented May 11, 2023

Describe the bug
When performing 3DS2 verification, app crashes on android.

To Reproduce

  1. create new Expo app,
  2. install SDK,
  3. use payment sheet,
  4. use test card with 3DS2,

Expected behavior
everything works

Screenshots

ERROR Your app just crashed. See the error below.
java.lang.RuntimeException: Unable to start activity ComponentInfo{cz.tlappka.v4/com.stripe.android.view.PaymentAuthWebViewActivity}: android.view.InflateException: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Error inflating class com.stripe.android.view.PaymentAuthWebView
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4169)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:226)
android.os.Looper.loop(Looper.java:313)
android.app.ActivityThread.main(ActivityThread.java:8757)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by android.view.InflateException: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Error inflating class com.stripe.android.view.PaymentAuthWebView

Caused by android.view.InflateException: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Error inflating class com.stripe.android.view.PaymentAuthWebView

Caused by java.lang.reflect.InvocationTargetException
java.lang.reflect.Constructor.newInstance0(Native Method)
java.lang.reflect.Constructor.newInstance(Constructor.java:343)
android.view.LayoutInflater.createView(LayoutInflater.java:876)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1028)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:983)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1145)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1148)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.inflate(LayoutInflater.java:692)
android.view.LayoutInflater.inflate(LayoutInflater.java:544)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:61)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:55)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:28)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:27)
kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
com.stripe.android.view.PaymentAuthWebViewActivity.getViewBinding(PaymentAuthWebViewActivity.kt:27)
com.stripe.android.view.PaymentAuthWebViewActivity.onCreate(PaymentAuthWebViewActivity.kt:58)
android.app.Activity.performCreate(Activity.java:8591)
android.app.Activity.performCreate(Activity.java:8570)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:226)
android.os.Looper.loop(Looper.java:313)
android.app.ActivityThread.main(ActivityThread.java:8757)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by java.lang.IllegalStateException: Calling View methods on another thread than the UI thread.
com.android.webview.chromium.WebViewChromium.b(chromium-TrichromeWebViewGoogle.aab-stable-561513533:25)
com.android.webview.chromium.WebViewChromium.init(chromium-TrichromeWebViewGoogle.aab-stable-561513533:97)
android.webkit.WebView.(WebView.java:448)
android.webkit.WebView.(WebView.java:368)
android.webkit.WebView.(WebView.java:350)
com.stripe.android.view.PaymentAuthWebView.(PaymentAuthWebView.kt:17)
com.stripe.android.view.PaymentAuthWebView.(PaymentAuthWebView.kt:13)
com.stripe.android.view.PaymentAuthWebView.(Unknown Source:11)
java.lang.reflect.Constructor.newInstance0(Native Method)
java.lang.reflect.Constructor.newInstance(Constructor.java:343)
android.view.LayoutInflater.createView(LayoutInflater.java:876)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1028)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:983)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1145)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1148)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.inflate(LayoutInflater.java:692)
android.view.LayoutInflater.inflate(LayoutInflater.java:544)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:61)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:55)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:28)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:27)
kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
com.stripe.android.view.PaymentAuthWebViewActivity.getViewBinding(PaymentAuthWebViewActivity.kt:27)
com.stripe.android.view.PaymentAuthWebViewActivity.onCreate(PaymentAuthWebViewActivity.kt:58)
android.app.Activity.performCreate(Activity.java:8591)
android.app.Activity.performCreate(Activity.java:8570)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:226)
android.os.Looper.loop(Looper.java:313)
android.app.ActivityThread.main(ActivityThread.java:8757)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Smartphone (please complete the following information):

  • Device: Samsung A53
  • OS: Android
  • Version: 13

Additional context
It seems like in android version this might have been fixed , but I am unable to use this version because Expo is locked to "@stripe/stripe-react-native": "0.23.3" which resolves to lower android sdk version I guess?

@zdnk zdnk changed the title Android: 3DS crashes Android: 3DS2 crashes May 11, 2023
@zdnk
Copy link
Author

zdnk commented May 11, 2023

It is 3DS2 that crashes. 3DS works fine.

@charliecruzan-stripe
Copy link
Collaborator

This is fixed now, but unfortunately will not work with Expo SDK 48 (unless you're able to use something like the dev client to upgrade your version of Stripe React Native). Otherwise, you'll have to wait for the next Expo SDK release

@zdnk
Copy link
Author

zdnk commented May 11, 2023

Can you elaborate on

unless you're able to use something like the dev client to upgrade your version of Stripe React Native

I have no idea what you mean by that.

And why do we need to wait for another Expo release, isnt this constrain of Stripe React Native?

@charliecruzan-stripe
Copy link
Collaborator

Sure! Here are docs on the dev client: https://docs.expo.dev/develop/development-builds/introduction/

isnt this constrain of Stripe React Native?

No, this is fixed in Stripe React Native. Expo would need to update their bundled version of this library to fix it in Expo Go

@zdnk
Copy link
Author

zdnk commented May 11, 2023

We are not using Expo Go, we using custom built dev client and obviously production builds. Expo Go is just for toying around. The thing is that everywhere in docs it is written that we should be using this specific version of Stripe RN with Expo 48, I dont understand why.

@charliecruzan-stripe
Copy link
Collaborator

I'm not an Expo expert, but I believe if you're using a custom dev client, you aren't constrained to the specific versions associated with an Expo SDK. But maybe there are some expo docs that can confirm that

@zdnk
Copy link
Author

zdnk commented May 11, 2023

I've just tested it and it crashes even if I use latest version of Stripe RN.

ERROR Your app just crashed. See the error below.
java.lang.RuntimeException: Unable to start activity ComponentInfo{cz.tlappka.v4/com.stripe.android.view.PaymentAuthWebViewActivity}: android.view.InflateException: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Error inflating class com.stripe.android.view.PaymentAuthWebView
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4169)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:226)
android.os.Looper.loop(Looper.java:313)
android.app.ActivityThread.main(ActivityThread.java:8757)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by android.view.InflateException: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Error inflating class com.stripe.android.view.PaymentAuthWebView

Caused by android.view.InflateException: Binary XML file line #21 in cz.tlappka.v4:layout/payment_auth_web_view_activity: Error inflating class com.stripe.android.view.PaymentAuthWebView

Caused by java.lang.reflect.InvocationTargetException
java.lang.reflect.Constructor.newInstance0(Native Method)
java.lang.reflect.Constructor.newInstance(Constructor.java:343)
android.view.LayoutInflater.createView(LayoutInflater.java:876)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1028)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:983)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1145)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1148)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.inflate(LayoutInflater.java:692)
android.view.LayoutInflater.inflate(LayoutInflater.java:544)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:61)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:55)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:28)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:27)
kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
com.stripe.android.view.PaymentAuthWebViewActivity.getViewBinding(PaymentAuthWebViewActivity.kt:27)
com.stripe.android.view.PaymentAuthWebViewActivity.onCreate(PaymentAuthWebViewActivity.kt:58)
android.app.Activity.performCreate(Activity.java:8591)
android.app.Activity.performCreate(Activity.java:8570)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:226)
android.os.Looper.loop(Looper.java:313)
android.app.ActivityThread.main(ActivityThread.java:8757)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by java.lang.IllegalStateException: Calling View methods on another thread than the UI thread.
com.android.webview.chromium.WebViewChromium.b(chromium-TrichromeWebViewGoogle.aab-stable-561513533:25)
com.android.webview.chromium.WebViewChromium.init(chromium-TrichromeWebViewGoogle.aab-stable-561513533:97)
android.webkit.WebView.(WebView.java:448)
android.webkit.WebView.(WebView.java:368)
android.webkit.WebView.(WebView.java:350)
com.stripe.android.view.PaymentAuthWebView.(PaymentAuthWebView.kt:17)
com.stripe.android.view.PaymentAuthWebView.(PaymentAuthWebView.kt:13)
com.stripe.android.view.PaymentAuthWebView.(Unknown Source:11)
java.lang.reflect.Constructor.newInstance0(Native Method)
java.lang.reflect.Constructor.newInstance(Constructor.java:343)
android.view.LayoutInflater.createView(LayoutInflater.java:876)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1028)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:983)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1145)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.rInflate(LayoutInflater.java:1148)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1106)
android.view.LayoutInflater.inflate(LayoutInflater.java:692)
android.view.LayoutInflater.inflate(LayoutInflater.java:544)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:61)
com.stripe.android.databinding.PaymentAuthWebViewActivityBinding.inflate(PaymentAuthWebViewActivityBinding.java:55)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:28)
com.stripe.android.view.PaymentAuthWebViewActivity$viewBinding$2.invoke(PaymentAuthWebViewActivity.kt:27)
kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
com.stripe.android.view.PaymentAuthWebViewActivity.getViewBinding(PaymentAuthWebViewActivity.kt:27)
com.stripe.android.view.PaymentAuthWebViewActivity.onCreate(PaymentAuthWebViewActivity.kt:58)
android.app.Activity.performCreate(Activity.java:8591)
android.app.Activity.performCreate(Activity.java:8570)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:226)
android.os.Looper.loop(Looper.java:313)
android.app.ActivityThread.main(ActivityThread.java:8757)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

@charliecruzan-stripe
Copy link
Collaborator

Can you share a reproducible demo? I'm not able to reproduce this crash in our test app

@zdnk
Copy link
Author

zdnk commented May 11, 2023

I can see why. You have locked version of Stripe Android SDK to 20.24.0 here, but the fix seems to be applied in 20.24.2.

@charliecruzan-stripe
Copy link
Collaborator

Ah that's right! Sorry, I thought we had already released the update. That'll be addressed in the next release, early next week

@zdnk
Copy link
Author

zdnk commented May 11, 2023

Well, Ill just go and ask. Can we do it sooner as in Europe and specially Czech Republic there are already banks running on 3DS2 and some of our customers cannot buy our services at this point? I'll even take a stretch and use a branch as dependency at this point :D

@zdnk
Copy link
Author

zdnk commented May 11, 2023

Or a lower version where this is issue is not.

@charliecruzan-stripe
Copy link
Collaborator

@zdnk it looks like that crash was introduced after stripe/stripe-android#6603, which went out in android SDK v20.24.1. The most recent version of stripe-react-native only supports 20.24.0 (as you stated above), so I'm not sure how you're triggering this crash (unless the root cause of this crash is different). I tested this with the steps you shared above:

  • create new app
  • use 0.27.1 (most recent @stripe/stripe-react-native)
  • use payment sheet,
  • use test card with 3DS2

on v0.27.1, and I'm not getting a crash 🤔 FWIW, I used the 3ds2 test card: 4000000000003220

@zdnk
Copy link
Author

zdnk commented May 11, 2023

Would you share the repo please? I'll try it tomorrow and see if I can replicate it. One thing that occurred to me now, is that we have the whole thing in modal screen. But there aren't any special modifications or behaviors implemented.

EDIT: just realized the modal presentation on Android is just regular screen/activity

@charliecruzan-stripe
Copy link
Collaborator

@zdnk
Copy link
Author

zdnk commented May 16, 2023

Seems like the issue is fixed in the latest version.

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

No branches or pull requests

2 participants