Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException: Attempt to invoke virtual method 'h.g.k.g.f h.g.b.d()' on a null object reference #7593

Closed
DenisPostnikov opened this issue Sep 2, 2022 · 16 comments

Comments

@DenisPostnikov
Copy link

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
@mcapocaccia
Copy link

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

@marf
Copy link

marf commented Sep 7, 2022

Same problem here.

@RaviMopo
Copy link

RaviMopo commented Sep 12, 2022

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)

@mcapocaccia
Copy link

mcapocaccia commented Sep 13, 2022

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

react-native-navigation+7.29.0.patch.zip

@yogevbd
Copy link
Collaborator

yogevbd commented Sep 14, 2022

Will add this fix in the next release, thanks!

@SYoder1
Copy link

SYoder1 commented Oct 13, 2022

Will add this fix in the next release, thanks!

@yogevbd Is there any ETA on when the next version is going to be release?

@stale
Copy link

stale bot commented Nov 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Nov 12, 2022
@Spencer-Yoder
Copy link

Bump

@stale
Copy link

stale bot commented Nov 22, 2022

The issue has been closed for inactivity.

@stale stale bot closed this as completed Nov 22, 2022
@ankitsingh08
Copy link
Contributor

@yogevbd Still facing this issue, any

Will add this fix in the next release, thanks!

Any update on including the fix, we are still seeing this crash from our crash reports

@androideveloper
Copy link

@yogevbd any updates on the new release? 🙏

@tarouboy
Copy link

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

react-native-navigation+7.29.0.patch.zip

Do you still receive crash reports after applying this patch?

@mcapocaccia
Copy link

@tarouboy No more crashes since we added the patch in our postinstall process

@tarouboy
Copy link

@tarouboy No more crashes since we added the patch in our postinstall process

Lovely. I will apply that patch too. Thanks man.

@ys-sherzad
Copy link

@yogevbd @mcapocaccia Hi there, if the patch is working. why wasn't it applied to the latest releases, I'm using 7.36.0?
#7769

@thuongtv-vn
Copy link

Hi All,

I am facing the same issue. But could not reproduce it even i pushed app to background. However, i have been received some mentioned error message.

Do you guys know exactly the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests