react-native-navigation
react-native-navigation copied to clipboard
java.lang.NullPointerException: Attempt to invoke virtual method 'h.g.k.g.f h.g.b.d()' on a null object reference
Hey there,
here's the stacktrace of the issue:
StackTrace
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'h.g.k.g.f h.g.b.d()' on a null object reference at com.reactnativenavigation.react.NavigationModule.navigator(NavigationModule.java:4) at com.reactnativenavigation.react.NavigationModule.access$100(NavigationModule.java) at com.reactnativenavigation.react.NavigationModule$1.lambda$onHostPause$0(NavigationModule.java:2) at com.reactnativenavigation.react.-$$Lambda$NavigationModule$1$YAogg-YWvGlqmTQTIc1m0ewJv3s.run(-.java:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Environment
- React Native Navigation version: "^7.29.0"
- React Native version:"0.66.3"
- Platform(s) (iOS, Android, or both?): Android
- Device info (Simulator/Device? OS version? Debug/Release?): samsung Galaxy S9, Release
Many crashes here too, same RNN and RN versions.
Crash is in NavigationModule.java:213
private Navigator navigator() {
return activity().getNavigator();
}
This is the context:
- app goes to background
- activity gets destroyed
- getCurrentActivity returns null, so "activity()" above is null
- crash
Same problem here.
I got crash like above
FATAL EXCEPTION: main Process, PID: 23622 java.lang.NullPointerException: Attempt to invoke virtual method 'f.i.k.g.f f.i.b.N()' on a null object reference at com.reactnativenavigation.react.NavigationModule.navigator(NavigationModule.java:1) at com.reactnativenavigation.react.NavigationModule.access$100(NavigationModule.java:1) at com.reactnativenavigation.react.NavigationModule$a.a(NavigationModule.java:1) at com.reactnativenavigation.react.NavigationModule$a.b(Unknown Source:0) at com.reactnativenavigation.react.b.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6523) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
We patched with the diff below in postinstall and the crash disappeared completely. @guyca @yogevbd it is a quite safe modification, you could consider patching 7.30.x
Will add this fix in the next release, thanks!
Will add this fix in the next release, thanks!
@yogevbd Is there any ETA on when the next version is going to be release?