NPE on AuthorizationManagementActivity.onResume (from Android framework?)
See original GitHub issueI can’t reproduce it myself, but on an app with around half million active users it’s happening on production from time to time. (we are using the latest AppAuth version 0.7.0).
Usually happening on these devices:
- Huawei 荣耀5X (HNKIW-Q) [Android 6.0]
- Galaxy TabS 10.5 (chagalllte) [Android 6.0]
- Gigaset GS170 (GS170) [Android 7.0]
- Galaxy J1 (j13g) [Android 4.4]
- Samsung Galaxy S5 mini (kminilte) [Android 6.0]
NPE:
java.lang.NullPointerException: android.app.Instrumentation in Attempt to invoke virtual method ‘boolean android.content.Intent.migrateExtraStreamToClipData()’ on a null object reference.execStartActivity
Stack trace:
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4225)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3426)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData()' on a null object reference
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1534)
at android.app.Activity.startActivityForResult(Activity.java:4298)
at android.app.Activity.startActivityForResult(Activity.java:4245)
at android.app.Activity.startActivity(Activity.java:4582)
at android.app.Activity.startActivity(Activity.java:4550)
at net.openid.appauth.AuthorizationManagementActivity.onResume(AuthorizationManagementActivity.java)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1287)
at android.app.Activity.performResume(Activity.java:7015)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4214)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3426)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:15 (1 by maintainers)
Top Results From Across the Web
java.lang.NullPointerException on onResume() - Stack Overflow
Inside the run method you have: InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);.
Read more >NullPointerException - Android Developers
On this page; Summary. Public constructors; Inherited methods. Public constructors. NullPointerException; NullPointerException. Android Developers.
Read more >Activity.OnResume Method (Android.App) | Microsoft Learn
This topic introduces these frameworks and discusses how to create custom graphics and animations for use in a Xamarin.Android application. Layouts - Xamarin....
Read more >Bug: NullPointerException: Resources.getConfiguration ...
NullPointerException : Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object ...
Read more >Fix "java.lang.NullPointerException" in Android Studio
Null Pointer Exception in Android Studio. NullPointerException in Android Studio highlighted in yellow color in the below screenshot. As you can ...
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
Hi, I believe I found the cause for this crash:
It occurs when you open the authorization request twice in a row (e.g. double-clicking your app’s login button which calls the AppAuth SDK twice via “performAuthorizationRequest” or “getAuthorizationRequestIntent”). The crash occurs after completing the login process and it tries to return back to your app.
I am temporarily fixing this issue by adding a boolean in my app to determine if the authorization is occurring already.
Our tester has managed to reproduce this problem. This happens if the user interrupts the flow, by following steps:
Stacktrace from our reproduction: