BrowserAuthorizationFragment.createCustomTabResponseIntent crash NullPointerException
See original GitHub issueDescribe the bug My app is live and got this bug when use start sign in, the bug was reported in Firebase Crashlystic
Smartphone (please complete the following information):
- Device: Xperia X
- Android Version: 8.0.0
- Browser: don’t know
- MSAL Version: 1.4.0
Stacktrace
Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference
android.content.ComponentName.<init> (ComponentName.java:131)
android.content.Intent.<init> (Intent.java:5698)
com.microsoft.identity.common.internal.providers.oauth2.BrowserAuthorizationFragment.createCustomTabResponseIntent (BrowserAuthorizationFragment.java:77)
com.microsoft.identity.client.BrowserTabActivity.onCreate (BrowserTabActivity.java:64)
android.app.Activity.performCreate (Activity.java:6975)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1214)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2778)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2900)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1601)
android.os.Handler.dispatchMessage (Handler.java:105)
android.os.Looper.loop (Looper.java:251)
android.app.ActivityThread.main (ActivityThread.java:6589)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)
To Reproduce
- Start user authentication screen
Expected behavior User can signed in
Actual Behavior Crash because of this error
Additional context
This bug is a random crash. Not all users have it. I checked the code where it crashes, the sCallingActivityClass
static field was null
that was used before it is set by BrowserAuthorizationFragment.createCustomTabResponseIntent(..)
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Major NullPointerException crash surfacing - Stack Overflow
I am facing the same issue almost across all my Apps. Admob version 20.5. regardless of SDK target the crash is gaining momentum....
Read more >Crash in java.lang.NullPointerException: at android.view.View ...
I can reproduce this on a Pixel 3 XL by locking the device with Firefox up, waking the device by bringing up the...
Read more >Bug: Application crashes due to NullpointerException while ...
This is the issue tracker for the Google Maps API, not the Google Maps Android application. Please send feedback through the built-in 'send...
Read more >How to fix Common Crashes, NullPointerException ... - YouTube
... on the stream about how to solve App crashes, and I decided to demonstrate how to solve a common error like a...
Read more >java.lang.NullPointerException: , crash in Android IMA sdk ...
Crash Log : Android 4.4, 5.0, 5.1, 6.0, 9.0. java.lang.NullPointerException: at com.google.ads.interactivemedia.v3.impl.data.y.create (y.java:32).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shahzaibj, we are also facing this bug. There are some devices (e.g. Xiaomi Mi A2 lite, Huawei P10 lite, LG K4, Polaroid Snap S60, LG X power) that this happens on (no specific Android version, seems to happen on all of them) Scenario is as follows:
It does not happens always, but usually there has to be about 3-4 bug occurences until user is able to proceed. Maybe there is a way to make this activity able to survive process death?
Also, changing authorization_user_agent setting to WEBVIEW helps, as mentioned in https://github.com/AzureAD/microsoft-authentication-library-for-android/issues/923, but we still have problem in register form, where after clicking privacy policy link, and coming back, activity is restarted. User cannot also change app to other during this process. For example to get code that was sent to email and has to be provided in app. After coming back, registration process is restarted.
@andj207 We’ve fixed this in MSAL v1.5.0 https://github.com/AzureAD/microsoft-authentication-library-for-android/releases/tag/v1.5.0