react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

Incompatible Types Error in Latest Stable Version 3.3.0

Open waleedshkt opened this issue 2 years ago • 4 comments

  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 :

  1. 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+

  1. 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

waleedshkt avatar Dec 18 '21 22:12 waleedshkt

You need to change like below, SplashScreen.show(this, true or false);

keiches avatar Dec 21 '21 11:12 keiches

@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?

waleedshkt avatar Dec 21 '21 15:12 waleedshkt

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)

Ibrahimsyah avatar Dec 22 '21 07:12 Ibrahimsyah

Please update documentation about this issue

daomtthuan avatar Nov 19 '22 21:11 daomtthuan