Closed nickmcmillan closed 2 years ago
Hi @nickmcmillan , this issue should be resolved, can you check again in the latest version(1.0.4)? https://github.com/kadiraydinli/react-native-system-navigation-bar/releases/tag/v1.0.3
Ah brilliant, I didn't see that PR. I'll upgrade to 1.0.4, thanks.
Happened for me on 1.0.4 (received logs via Sentry).
Seems like getCurrentActivity()
could return null as well. According to the logs it seems that the user started the app and quite quickly minimized it (e.g. by pressing Home button on the phone). Though, I wasn't able to reproduce it
Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
com.reactnativesystemnavigationbar.SystemNavigationBarModule in setNavigationColor at line 123
java.lang.reflect.Method in invoke
com.facebook.react.bridge.JavaMethodWrapper in invoke at line 372
com.facebook.react.bridge.JavaModuleWrapper in invoke at line 188
com.facebook.react.bridge.queue.NativeRunnable in run
android.os.Handler in handleCallback at line 938
android.os.Handler in dispatchMessage at line 99
com.facebook.react.bridge.queue.MessageQueueThreadHandler in dispatchMessage at line 27
android.os.Looper in loop at line 246
com.facebook.react.bridge.queue.MessageQueueThreadImpl$4 in run at line 226
java.lang.Thread in run at line 9233
My React Native (not Expo) app is reporting several crashes (via Firebase Crashlytics) which appear related to this module (
1.0.2
):This error never occurred before using this module. It's happening across Android versions 10, 11, 12.
From reading that error log it kind of sounds like
setNavigationColor
is being called too soon? I'm calling it likeSystemNavigationBar.setNavigationColor("#FDF7F5", false)
from inside auseEffect
where I'd assume it should be fine to do so.