Closed BajrangS closed 8 months ago
Here's the crash log from my app
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.rnappauth.RNAppAuthModule.onActivityResult(RNAppAuthModule.java:419)
at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:305)
at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:762)
at com.facebook.react.ReactDelegate.onActivityResult(ReactDelegate.java:90)
at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:112)
at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:68)
at android.app.Activity.dispatchActivityResult(Activity.java:8304)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5006)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5054)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=52, result=-1, data=Intent { dat=com.****.auth0://callback?code=**** (has extras) }} to activity {com.****/com.****.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:5013)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5054)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
This might be a different reason for crashing, but I was able to resolve my crash by adding in
dangerouslyAllowInsecureHttpRequests: true
I don't know how to check android's native log so I am not sure if its the same error. But in my research to resolve my issue, I ended up here and issue #600 a couple times, so I hope this can help anyone suffering from the same error.
This issue occurs on low-end Android devices that kill the Activity when your app is backgrounded during the authentication process. We persist values in private instance fields so we can read/use them during the code/token exchange in our onActivityResult
handler. We end up getting a null pointer exception because these values don't exist when we go to read them. Notice the first line in the posted stack trace
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.rnappauth.RNAppAuthModule.onActivityResult(RNAppAuthModule.java:419)
I've talked with the other maintainers and we are going to try to get around to a fix for this. I can't provide a timeline, but just a heads up that it's on our radar. There are a few issues in the repo where this is the root cause.
Also investigating this issue presently. Can't help but notice that while https://github.com/Nirodha26/react-native-app-auth/pull/1 put in what may be a fix for this issue in January, the releases since then have not included this update.
Edit: My mistake, I see that that is on a fork. Any chance of that getting merged into official?
Also investigating this issue presently. Can't help but notice that while Nirodha26#1 put in what may be a fix for this issue in January, the releases since then have not included this update.
Edit: My mistake, I see that that is on a fork. Any chance of that getting merged into official?
@Jay-A-McBee any chance this possible fix would resove the issue and can be merged here ?
It would be great if this fix was merged into official and added in a next release.
Hello @Jay-A-McBee It does not just happen in low-end devices it also happens in so many high-end ones. Is there any chance to get the PR merged or solve this issue?
Is there any update about this issue @Jay-A-McBee ?
Are there any plans of including this change https://github.com/Nirodha26/react-native-app-auth/pull/1 in an official release to fix this issue?
Will this issue be fixed soon or is the library not longer maintained?
We are facing the same issue. Any updates?
seeing similar errors in our App Center crash results:
com.rnappauth.RNAppAuthModule.onActivityResult RNAppAuthModule.java, line 504 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
main thread:
com.rnappauth.RNAppAuthModule.onActivityResult RNAppAuthModule.java:504
com.facebook.react.bridge.ReactContext.onActivityResult ReactContext.java:375
com.facebook.react.ReactInstanceManager.onActivityResult ReactInstanceManager.java:822
com.facebook.react.ReactDelegate.onActivityResult ReactDelegate.java:107
com.facebook.react.ReactActivityDelegate.onActivityResult ReactActivityDelegate.java:136
com.facebook.react.ReactActivity.onActivityResult ReactActivity.java:70
android.app.Activity.dispatchActivityResult Activity.java:8310
android.app.ActivityThread.deliverResults ActivityThread.java:5023
android.app.ActivityThread.handleSendResult ActivityThread.java:5071
android.app.servertransaction.ActivityResultItem.execute ActivityResultItem.java:51
android.app.servertransaction.TransactionExecutor.executeCallbacks TransactionExecutor.java:135
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:95
android.app.ActivityThread$H.handleMessage ActivityThread.java:2070
android.os.Handler.dispatchMessage Handler.java:106
android.os.Looper.loop Looper.java:223
android.app.ActivityThread.main ActivityThread.java:7711
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:592
com.android.internal.os.ZygoteInit.main ZygoteInit.java:952
android.app.ActivityThread.deliverResults ActivityThread.java:5030
android.app.ActivityThread.handleSendResult ActivityThread.java:5071
android.app.servertransaction.ActivityResultItem.execute ActivityResultItem.java:51
android.app.servertransaction.TransactionExecutor.executeCallbacks TransactionExecutor.java:135
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:95
android.app.ActivityThread$H.handleMessage ActivityThread.java:2070
android.os.Handler.dispatchMessage Handler.java:106
android.os.Looper.loop Looper.java:223
android.app.ActivityThread.main ActivityThread.java:7711
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:592
com.android.internal.os.ZygoteInit.main ZygoteInit.java:952
From devices like:
We are using react-native-app-auth version 7.1.0, which is latest right now, but this has been happening for a while now.
We are also seeing some iOS errors too, but can't see any relation to this for now.
Same here, experiencing crashes on our production App. Mainly on HUAWEI P smart 2019, but others too, like Galaxy S21 5G and A52s 5G, Redmi Note 9 and 11 5G,...
More than 3 years since this issue was filed and still no fix, is this library still maintained actively?
Experiencing the same issue even on the latest devices like the Galaxy S24 Ultra, any help would be appreciated.
Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=52, result=-1, data=Intent { dat=***app.auth://oauth/... (has extras) }} to activity {***app/***app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:6062) at android.app.ActivityThread.handleSendResult(ActivityThread.java:6101) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8918) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
any update on this?
This happens on multiple production device( samsung q4q,OnePlus OnePlusN200TMO,motorola berlna,motorola denver etc)
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference at com.rnappauth.RNAppAuthModule.onActivityResult (RNAppAuthModule.java:492) at com.facebook.react.bridge.ReactContext.onActivityResult (ReactContext.java:338) at com.facebook.react.ReactInstanceManager.onActivityResult (ReactInstanceManager.java:824)
Hi everyone, we don't currently have any resources able to take on this work, but are happy to accept PRs from the community.
Hi everyone, we don't currently have any resources able to take on this work, but are happy to accept PRs from the community.
Thanks for all your work on this library, there are now a few PRs still open for a while. I have just submitted mine with the solution suggested by @yberstad which I can say it works on our end.
https://github.com/FormidableLabs/react-native-app-auth/issues/564
@RubenPM-dev Thanks for the PR, we will review it as soon as possible.
Issue
Firebase crashlytics report below crash issue in react-native app Android. There is no issues in iOS.
Caused by java.lang.NullPointerException Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
com.rnappauth.RNAppAuthModule.onActivityResult (RNAppAuthModule.java:414)
Environment
Your Identity Provider:
e.g. IdentityServer 4 / Okta / Azure
Unable to identify because this is NPM module level crashPlatform that you're experiencing the issue on:
iOS / Android / both
Platform: AndroidAre you using Expo? No
Please provide suggestions to fix this issue.