You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for the great library. Only way I was able to set the theme in the Android app status bar and navigation bar.
I am running into this crash lately.
I am calling this in my code: SystemNavigationBar && SystemNavigationBar.setBarMode && SystemNavigationBar.setBarMode(isDarkMode ? 'light' : 'dark');
I added the checks because I wanted to see if that would fix it, but it did not.
Here is the crash I am seeing:
Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference com.reactnativesystemnavigationbar.SystemNavigationBarModule.setModeStyle (SystemNavigationBarModule.java:472) com.reactnativesystemnavigationbar.SystemNavigationBarModule.lambda$setModeStyle$8$SystemNavigationBarModule (SystemNavigationBarModule.java:521) com.reactnativesystemnavigationbar.-$$Lambda$SystemNavigationBarModule$7c9Wq1aEzZlZVxbqz80nWTlUwis.run (Unknown Source:8) android.os.Handler.handleCallback (Handler.java:942)
I am not able to reproduce the issue, but I am seeing it in crashlytics.
Here are some of the devices it is happening on:
Android 14 Pixel 6
Android 14 Galaxy S22
Android 13 Oppo Reno8 5G
Android 11 Realme C3
Android 10 Galaxy Note9
Android 10 Note3
Please let me know if there is anything else that would be helpful. Thank you!
react-native-system-navigation-bar version
2.6.3
React Native version
0.62.2
Snack, code example, screenshot, or link to a repository
import SystemNavigationBar from 'react-native-system-navigation-bar';
@kadiraydinli Hi, it still happens on version 2.6.4, the crashes I got are from Android 11,12,13,14.
stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
at com.reactnativesystemnavigationbar.SystemNavigationBarModule.setModeStyle(SystemNavigationBarModule.java:474)
at com.reactnativesystemnavigationbar.SystemNavigationBarModule.lambda$setNavigationColor$1(SystemNavigationBarModule.java:260)
at com.reactnativesystemnavigationbar.SystemNavigationBarModule.$r8$lambda$2vOhle1R4mCvq8Qvlxo7ugiWWaI(Unknown)
at com.reactnativesystemnavigationbar.SystemNavigationBarModule$$ExternalSyntheticLambda4.run(Unknown:12)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Method.java:-2)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
maybe something like this could get around the crash:
Description
Hi, thank you for the great library. Only way I was able to set the theme in the Android app status bar and navigation bar.
I am running into this crash lately.
I am calling this in my code:
SystemNavigationBar && SystemNavigationBar.setBarMode && SystemNavigationBar.setBarMode(isDarkMode ? 'light' : 'dark');
I added the checks because I wanted to see if that would fix it, but it did not.
Here is the crash I am seeing:
Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference com.reactnativesystemnavigationbar.SystemNavigationBarModule.setModeStyle (SystemNavigationBarModule.java:472) com.reactnativesystemnavigationbar.SystemNavigationBarModule.lambda$setModeStyle$8$SystemNavigationBarModule (SystemNavigationBarModule.java:521) com.reactnativesystemnavigationbar.-$$Lambda$SystemNavigationBarModule$7c9Wq1aEzZlZVxbqz80nWTlUwis.run (Unknown Source:8) android.os.Handler.handleCallback (Handler.java:942)
I am not able to reproduce the issue, but I am seeing it in crashlytics.
Here are some of the devices it is happening on:
Android 14 Pixel 6
Android 14 Galaxy S22
Android 13 Oppo Reno8 5G
Android 11 Realme C3
Android 10 Galaxy Note9
Android 10 Note3
Please let me know if there is anything else that would be helpful. Thank you!
react-native-system-navigation-bar version
2.6.3
React Native version
0.62.2
Snack, code example, screenshot, or link to a repository
import SystemNavigationBar from 'react-native-system-navigation-bar';
SystemNavigationBar && SystemNavigationBar.setBarMode && SystemNavigationBar.setBarMode(isDarkMode ? 'light' : 'dark');
The text was updated successfully, but these errors were encountered: