question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native-app-auth module getting crashed in Android

See original GitHub issue

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 crash

  • Platform that you’re experiencing the issue on: iOS / Android / both Platform: Android

  • Are you using Expo? No

Please provide suggestions to fix this issue.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
Jay-A-McBeecommented, Mar 27, 2022

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.

3reactions
sandergo90commented, Oct 4, 2022

Is there any update about this issue @Jay-A-McBee ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Center Crashes for React Native - Microsoft Learn
App Center supports Breakpad crashes from Android NDK in a React Native apps. Follow the normal setup steps above, and in your MainActivity.java ......
Read more >
React native app crashes on start when add " apply plugin ...
I am integrating firebase into my react-native android app. ... in gradle file at "/android/app/build.gradle", my app crashes on startup.
Read more >
Crashlytics - React Native Firebase
This module requires that the @react-native-firebase/app module is already setup and installed. To install the "app" module, view the Getting Started ...
Read more >
Crashes | Android Developers
There are many situations that can cause a crash in your app. Some reasons are obvious, like checking for a null value or...
Read more >
react-native-app-auth - Formidable Labs
ANDROID This will prefetch the authorization service configuration. Invoking this function is optional and will speed up calls to authorize. This is only ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found