wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.02k stars 2.67k forks source link

Fatal Exception: java.lang.NullPointerException #7769

Closed ys-sherzad closed 10 months ago

ys-sherzad commented 1 year ago

What happened?

This issue is becoming recurrent even though we're relatively using the latest version of the package.

Stack trace from crashlytics:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'com.reactnativenavigation.viewcontrollers.navigator.Navigator com.reactnativenavigation.NavigationActivity.getNavigator()' on a null object reference
       at com.reactnativenavigation.react.NavigationModule.navigator(NavigationModule.java:213)
       at com.reactnativenavigation.react.NavigationModule.access$100(NavigationModule.java:39)
       at com.reactnativenavigation.react.NavigationModule$1.lambda$onHostPause$0$com-reactnativenavigation-react-NavigationModule$1(NavigationModule.java:62)
       at com.reactnativenavigation.react.NavigationModule$1$$ExternalSyntheticLambda0.run(:2)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:210)
       at android.os.Looper.loop(Looper.java:299)
       at android.app.ActivityThread.main(ActivityThread.java:8319)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)

What was the expected behaviour?

Should not throw exceptions.

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version: 7.36.0 React Native version: 0.71.1 Has Fabric (React Native's new rendering system) enabled: no Node version: Device model: Poco X3 NFC, Galaxy A21s, Galaxy A53 5G, Galaxy S22 Ultra, Galaxy S9, Galaxy S8 Android version: 13, 12, 10, 9

mcapocaccia commented 12 months ago

@ys-sherzad I recommend you take a look at the patch here It has eliminated this crash for us.

thuongtv-vn commented 10 months ago

Hi @ys-sherzad I got the same error message but don't know how to reproduce it. Could you please tell me the steps to catch it? Thanks!