-
Notifications
You must be signed in to change notification settings - Fork 79
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
NullPointerException upon returning to app #441
Comments
Hi @Buakenze thanks for using the Braintree SDK for Android. I agree this is strange behavior, but the fact that it's reproducible is promising. The stack trace references this line in DropInActivity.java. Here, we're looking for an intent extra that contains the original The only way I could see this value not being present is if |
Hi @sshropshire, thank you for your reply. |
Actually that is a good observation. Is there something in the UI layer that may cause it to launch twice? |
I believe there isn't, I confirmed I have only one DropInClient instance and launchDropIn is called only once. What else could cause it to fire twice? As I stated in the main post I had tried overriding onNewIntent as stated here, but currently that code is commented and I'm getting the same result. |
Did you find any workaround or possibly a solution? |
@sshropshire And the message precisely says, The weird thing is, if I use the same process on a sample app or example app it works fine, but when I use it in my actual app it throws this error. Below is my androidmanifest.xml config,
|
@sshropshire |
Hey @BunnyBuddy unfortunately no. If it's working in the sample app then it may help our team to learn the exact steps to reproduce. It's difficult for me to say what the root cause is since it's working in the demo app. I would try to align your app's manifest as closely as possible to demo app's manifest and take note of which change causes the issue to be resolved. I'd also repeat these steps for your app's |
Braintree SDK Version
4.38.2
Environment
Sandbox
Android Version & Device
Samsung Galaxy A34, Android 13
Braintree dependencies
com.braintreepayments.api:drop-in:6.13.0
Describe the bug
Upon returning to app after selecting a paypal payment method I get a NullPointerException:
I found other issues with this error namely #403 and #404 but no solution was given. In my case, it happens everytime.
The crash happens both with an emulator and physical device. I can't understand what I'm doing wrong, it should be a very basic implementation. I have a single activity architecture where I needed the DropInClient inside a fragment, and I even tried moving the logic to the activity to no avail. I am only using the DropInClient, not the BraintreeClient.
I also tried overriding onNewIntent as stated here, even though this refers to PayPalClient.
In my activity I have:
I tried fiddling a bit with the intent filters since I read here #419 (comment) that I shouldn't declare it as stated in the documentation (hence the commented part). As for the DropInActivity intent filter, I found it somewhere else in another issue, but can't understand if it's needed or not. I'm still getting the same null pointer either if I declare the intent filter or not.
If I declare the intent filter in my activity, I get two choices to get back to the app (duplicated intent filters it seems): one gets me a UserCanceledException, the other gives me the NullPointerException mentioned above.
I'm also getting the same exception with drop in versions 6.10 and 6.12. I upgraded in hope a later version would solve the issue.
Thank you in advance for your attention.
To reproduce
Expected behavior
getting a callback to onDropInSuccess or onDropInFailure
Screenshots
No response
The text was updated successfully, but these errors were encountered: