-
Notifications
You must be signed in to change notification settings - Fork 663
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
[BUG] Crash when calling PaymentLauncher.confirm(params:) #4739
Comments
Hi @reiaz-gafar, thank you for reporting this issue. Can you provide a little more information:
|
Hi @jameswoo-stripe.
|
@reiaz-gafar, thanks for the information. Been trying to reproduce this issue without any success, it is hard to find out why the coroutine is cancelling without more information. I can propose a bandaid solution that will just wrap the In the meantime, it would be helpful to understand how you are using
|
Thanks for looking into this @jameswoo-stripe. I've created a stripped down sample app where I'm still seeing the issue here: https://github.com/reiaz-gafar/stripe-manual-entry-crash. It still has the same crash location
As for our main app where it's crashing to answer your questions:
|
There may also be a reason to believe that Locale has something to do with this, is there something in the SDK that uses the locale to construct anything in this flow? The reason I'm mentioning this is that we have a colleague in the UK that has the exact same code and does NOT crash, but myself and others in the New York City region ARE crashing. |
Hi @reiaz-gafar thanks so much for the sample app. I tried it out and was not able to reproduce the issue. I am based in the Seattle region and I am not able to get a crash. I tested multiple emulators, upgraded my kotlin version, but no luck so far. My machine:
Android emulator:
Here are some questions I have:
|
@jameswoo-stripe Thanks for continuing to look at this. To answer your questions:
Here's a video of the crash that I'm seeing in the sample app I posted earlier: crash.mov |
@reiaz-gafar Thank you so much for the detailed responses! This was extremely valuable information and we have found the issue. This issue seems to happen on landscape mode and not portrait mode. There is a configuration change which causes the |
@jameswoo-stripe Awesome, that's great to hear! Thanks so much for taking the time to look into this. Any tentative idea on how long it will take to release? |
@reiaz-gafar You can subscribe to this PR: #4776. Once merged we can discuss about releasing a patch fix. In the meantime, can you work on this using portrait mode (e.g. using a phone instead of a tablet)? |
@jameswoo-stripe Thanks for raising that PR, I have suscribed. Unfortunately our app is locked to landscape mode so we are blocked until this patch is released. Thanks again for looking into this and communicating well! |
Hi @reiaz-gafar, the fix is merged and we are scheduling a release for April 4. Once released, feel free to update your dependency. Please let us know if you run into more issues. |
@jameswoo-stripe Amazing, thanks so much for the quick resolution! |
@jameswoo-stripe Tried out the new release. Unfortunately I'm still getting a crash, not the same one as before though.
The payment is still succesfully confirmed on the dashboard as well. I tried the same exact app in portrait mode and it works fine. Any ideas on why it's still happening? |
@reiaz-gafar I have tried reproducing the issue you are seeing with a tablet in landscape mode in both our example app and the app that you posted previously. Unfortunately, I am unable to see the issue you are seeing. Have you tried invalidating and restarting Android Studio, clearing the gradle cache, cleaning and rebuilding? 20.0.0 does include some breaking changes, but I can't see anything that would have changed with |
@jameswoo-stripe Let me do a bit more investigation and get back, it can totally be something on our side. |
Hi @jameswoo-stripe, I see below code in PaymentLauncherConfirmationActivity.kt which changes activity orientation to portrait mode. This might explain why we have this issue.
|
Hi @jameswoo-stripe I tried the latest SDK in portrait and it does crash the application for me too. However, if I run it on an emulator that is specifically SDK 26 (Android Oreo), it works fine. That would indicate to me that it is this line that is causing the crash. What would be the ramifications if you were to just remove the orientation line completely? |
Hi @jameswoo-stripe, my teammates posted some of their findings above, what do you think of them? |
@anandkumarnyc, @keithmacklin, @reiaz-gafar, thanks for the follow up. I am consulting with the team to see if we can remove the force portrait mode. |
@anandkumarnyc @keithmacklin @reiaz-gafar here is a potential workaround PR up: #4855 |
@anandkumarnyc @keithmacklin @reiaz-gafar hi folks, #4855 was merged. Please be on the lookout for a release this Monday. |
@reiaz-gafar Please update to 20.1.0 and let us know if this fixes your issue. |
@jameswoo-stripe It's looking pretty good now, thanks! Going to do a bit more testing but everything seems to be in order 🤞 |
Great, thank you for the update! Feel free to open a new issue if you find one. |
Summary
When trying to use the PaymentLauncher to confirm a payment, it crashes the app.
Code to reproduce
paymentLauncher.confirm(confirmParams)
Android version
Using Android 12, happening on Stripe SDK versions 17+
Impacted devices
Happens on all devices tried on.
Installation method
Gradle
Dependency Versions
kotlin: 1.6.10
stripe-android: 19.3.0
Android Gradle Plugin: 7.1.2
Gradle: 7.3.3
SDK classes
PaymentLauncher
Video
Other information
The payment intent in Stripe dashboard indicates that the payment intent was successfully confirmed, but we crash before we receive the callback.
Stack trace:
The text was updated successfully, but these errors were encountered: