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.

NullPointerException in createConnectionBuilder (Android)

See original GitHub issue

We just release a new app based on React Native and react-native-app-auth and Azure AD as IDP.

react-native-app-auth: 5.0.0-rc3 react-native: 0.61.5 react: 16.9.0

We never saw this during testing with emulator and a Huawei P30(Android 9). But now we have logged hundreds of these errors over the last couple of days, on a range of different phone models, and Android 8, 9 and 10. iOS seems fine.

Based on the exception, it seems like dangerouslyAllowInsecureHttpRequests. How could this be? This seems related to this issue: https://github.com/FormidableLabs/react-native-app-auth/issues/95

Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'boolean java.lang.Boolean.equals(java.lang.Object)' on a null 

com.rnappauth.RNAppAuthModule.createConnectionBuilder (RNAppAuthModule.java:546)
com.rnappauth.RNAppAuthModule.onActivityResult (RNAppAuthModule.java:316)
com.facebook.react.bridge.ReactContext.onActivityResult (ReactContext.java:275)
com.facebook.react.ReactInstanceManager.onActivityResult (ReactInstanceManager.java:703)
com.facebook.react.ReactDelegate.onActivityResult (ReactDelegate.java:89)
com.facebook.react.ReactActivityDelegate.onActivityResult (ReactActivityDelegate.java:110)
com.facebook.react.ReactActivity.onActivityResult (ReactActivity.java:67)
android.app.Activity.dispatchActivityResult (Activity.java:7193)
android.app.ActivityThread.deliverResults (ActivityThread.java:4280)
android.app.ActivityThread.handleSendResult (ActivityThread.java:4327)
android.app.ActivityThread.-wrap22 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1624)
android.os.Handler.dispatchMessage (Handler.java:105)
android.os.Looper.loop (Looper.java:156)
android.app.ActivityThread.main (ActivityThread.java:6523)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:942)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:832)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thymikeecommented, Jul 15, 2020

Looks like this is fixed by https://github.com/FormidableLabs/react-native-app-auth/commit/0b356a541c5c8e713d3f27c523f3b55b87ead999, included in v5.1.2. Please close this issue 😃

0reactions
DrSchrumpficommented, Feb 25, 2020

@kadikraman We are using 5.0.2 and getting a lot of reports via Google Play Console:

Caused by: java.lang.NullPointerException: at com.rnappauth.RNAppAuthModule.createConnectionBuilder (RNAppAuthModule.java:713) at com.rnappauth.RNAppAuthModule.onActivityResult (RNAppAuthModule.java:396) at com.facebook.react.bridge.ReactContext.onActivityResult (ReactContext.java:275) at com.facebook.react.ReactInstanceManager.onActivityResult (ReactInstanceManager.java:703) at com.facebook.react.ReactDelegate.onActivityResult (ReactDelegate.java:89) at com.facebook.react.ReactActivityDelegate.onActivityResult (ReactActivityDelegate.java:110) at com.facebook.react.ReactActivity.onActivityResult (ReactActivity.java:67) at android.app.Activity.dispatchActivityResult (Activity.java:7393) at android.app.ActivityThread.deliverResults (ActivityThread.java:4560)

Changing line 713 to

if (Boolean.TRUE.equals(allowInsecureConnections)) {

might help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null pointer exception error in android - java - Stack Overflow
I am getting the following exception when I run the texter application in android. STACK_TRACE : java.lang.NullPointerException at ...
Read more >
NullPointerException - Android Developers
NullPointerException objects may be constructed by the virtual machine as if stack trace was ... Constructs a NullPointerException with no detail message.
Read more >
Fix "java.lang.NullPointerException" in Android Studio
Hey Geeks, today we will see what NullPointerException means and how we can fix it in Android Studio. To understand NullPointerException ...
Read more >
NullPointerException Constructor (Java.Lang) - Microsoft Learn
Constructs a NullPointerException with no detail message. ... page are modifications based on work created and shared by the Android Open Source Project...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
NullPointerException. java lang nullpointerexception hierarchy. NullPointerException is a runtime exception, so we don't need to catch it in the ...
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 Reddit Thread

No results found

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