You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating braintree Android SDK version from 3.12.0 to 3.13.0 we have started observing following exception in our crash logs which are related to BraintreeFragment. I think it is happening because activity is becoming null in some certain cases.
This crash is infrequent but we are observing it with significant numbers. BTW, it started immediately after updating version from 3.12.0 to 3.13.0.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.app.Activity.getApplicationContext()' on a null object reference
at com.braintreepayments.api.BraintreeFragment.getReturnUrlScheme(BraintreeFragment.java:390)
at com.braintreepayments.api.PayPal.populateRequestData(PayPal.java:513)
at com.braintreepayments.api.PayPal.getCheckoutRequest(PayPal.java:459)
at com.braintreepayments.api.PayPal$1.success(PayPal.java:171)
at com.braintreepayments.api.internal.HttpClient$3.run(HttpClient.java:288)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
It seems that it is caused by the change done in new version (3.13.0). Here is the link to the changed method that causes the issue.
Hi @hakanbagci thanks for using the Braintree SDK for Android. We see the issue, and we're working on a fix.
It seems like this could occur when the BraintreeFragment is no longer attached to an Activity. Out of curiosity, were you able to reproduce this with a consistent set of steps?
Hi @sshropshire, thanks for the quick response. This crash is happening rarely and unfortunately, we were not able to reproduce it. One more insight about the crash is that devices are always in the foreground.
General Information
Min SDK Version: 21
Issue description
After updating braintree Android SDK version from 3.12.0 to 3.13.0 we have started observing following exception in our crash logs which are related to
BraintreeFragment
. I think it is happening because activity is becomingnull
in some certain cases.This crash is infrequent but we are observing it with significant numbers. BTW, it started immediately after updating version from
3.12.0
to3.13.0
.It seems that it is caused by the change done in new version (3.13.0). Here is the link to the changed method that causes the issue.
braintree_android/Braintree/src/main/java/com/braintreepayments/api/BraintreeFragment.java
Line 389 in c4df795
The text was updated successfully, but these errors were encountered: