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

NullPointerException in PopupBridge.runJavaScriptInWebView #25

Closed
herbeth1u opened this issue Jun 29, 2020 · 3 comments
Closed

NullPointerException in PopupBridge.runJavaScriptInWebView #25

herbeth1u opened this issue Jun 29, 2020 · 3 comments

Comments

@herbeth1u
Copy link

General information

  • SDK/Library version: 2.0.0
  • Android Version and Device: Multiple devices from multiple OEMs (60% Xiaomi Mi A2 Lite, then BlackBerry, Sony and WIKO), all Android versions (6, 8, 9, 10).

Issue description

Hello. We've got some Crashlytics reports that appeared since we integrated PopupBridge in our application. Not reproduced on our own devices, but still affecting some of our users:

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.View.post(java.lang.Runnable)' on a null object reference
       at com.braintreepayments.popupbridge.PopupBridge.runJavaScriptInWebView(PopupBridge.java:100)
       at com.braintreepayments.popupbridge.PopupBridge.onBrowserSwitchResult(PopupBridge.java:153)
       at com.braintreepayments.browserswitch.BrowserSwitchFragment.onResume(BrowserSwitchFragment.java:73)
       at androidx.fragment.app.Fragment.performResume(Fragment.java:2747)
       at androidx.fragment.app.FragmentStateManager.resume(FragmentStateManager.java:373)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
       at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2625)
       at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:2589)
       at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:269)
       at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:478)
       at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:467)
       at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195)
       at android.app.Activity.performResume(Activity.java:7184)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3694)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3766)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2939)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1615)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:231)
       at android.app.ActivityThread.main(ActivityThread.java:6749)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Feel free to ask for more details.
Thank you!

@sshropshire
Copy link
Contributor

Hi @herbeth1u thanks for using the Braintree SDK for Android. Are a large percentage of your users experiencing this issue? It seems like the WebView reference becomes null at some point.

Are you able to provide steps to reproduce the issue?

@herbeth1u
Copy link
Author

herbeth1u commented Jun 29, 2020

Hi @sshropshire, thanks for the quick reply. Only a small percentage of our users are affected by this crash (~1 for 10000 users). This is also why we haven't been able to reproduce the issue yet, so we can't provide steps to reproduce at the moment.

@sshropshire
Copy link
Contributor

@herbeth1u I understand. Unfortunately, I'll have to close this issue for now until we can get some steps to reproduce on our end.

If you're able to get more information about this small subset of users to determine repro steps, feel free to create another issue and we'll take a look.

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