react-native-splash-screen
react-native-splash-screen copied to clipboard
Incompatible Types Error in Latest Stable Version 3.3.0
Binaries:
Node: 14.16.1
Yarn: 1.22.11
npm: 6.14.12
Languages:
Java: 15.0.2
npmPackages:
react: 17.0.2 => 17.0.2
react-native: 0.66.4 => 0.66.4
What react-native-splash-screen
version are you using?
3.3.0
What platform does your issue occur on? (Android/iOS/Both) Android (not sure about on iOS)
Describe your issue as precisely as possible :
- Steps to reproduce the issue or to explain in which case you get the issue
Just install the new version and configured the android MainActivity.java to show splash screen on app initial load as in the docs. No need to manually link the dependency as (obvious) auto-linking is available in react-native v0.60+
-
Interesting
logs
E:\[PROJECT_NAME_HERE]\android\app\src\main\java\com\[APP_NAME_HERE]\MainActivity.java:11: error: incompatible types: int cannot be converted to boolean
SplashScreen.show(this, R.style.SplashStatusBarTheme);
SplashStatusBarTheme
is a custom style name defined in android\app\src\main\res\values\styles.xml
Interestingly, when downgrading to version 3.2.0, it all works fine
You need to change like below, SplashScreen.show(this, true or false);
@keiches Right. But I'm following the docs and adding a custom status bar color.
And why is this error occurring in the latest version but not in 3.2.0?
Same error here. I think we have to specify whether we want it to be fullscreen on not.
SplashScreen.show(this, R.style.YourTheme, true); // false to disable fullscreen
There are 3 overloading method of Show() here SplashScreen.java , but no one has parameter (Activity activity, int themeResId)
Please update documentation about this issue