zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.75k stars 259 forks source link

Double splash screen warning on Google Play Console side #446

Closed Kaosc closed 1 year ago

Kaosc commented 1 year ago

Bug summary

I switched from expo-splash-screen to this package cause of the new splash screen api for android 12 and above. I succesfuly implemented the package and tested with api 29, 30, 31 and 33 android. There was not visualy shows a double splash screen at all but it gives the below double splash screen warning and performance warnings in pre-luanch report on console.

Users launching your app on Android 12 or higher are seeing 2 splash screens. To fix, update your app to use the SplashScreen API.

Here is my implementation

import com.zoontek.rnbootsplash.RNBootSplash;

@Override
 protected void onCreate(Bundle savedInstanceState) {
   RNBootSplash.init(this);
   super.onCreate(null);
 }
dependencies {
    implementation 'androidx.core:core-splashscreen:1.0.0'
}
<application android:theme="@style/AppTheme">
   <activity android:theme="@style/BootTheme">
       ...
   </activity>
</application
  <style name="BootTheme" parent="Theme.SplashScreen">
    <item name="windowSplashScreenBackground">@color/bootsplash_background</item>
    <item name="windowSplashScreenAnimatedIcon">@mipmap/bootsplash_logo</item>
    <item name="postSplashScreenTheme">@style/AppTheme</item>
  </style>

Library version

4.6.0

Environment info

Binaries:
    Node: 16.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: 20230408.180552.0 - C:\ProgramData\chocolatey\bin\watchman.EXE
  SDKs:
    Android SDK:
      API Levels: 29, 30, 31, 33
      Build Tools: 30.0.3, 33.0.0, 33.0.2
      System Images: android-30 | Google Play Intel x86 Atom, android-31 | Google Play Intel x86_64 Atom, android-33 | Google Play Intel x86_64 Atom
      Android NDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Disabled
  IDEs:
    Android Studio: AI-222.4459.24.2221.9862592
    Visual Studio: Not Found
  Languages:
    Java: 11.0.18
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.6 => 0.71.6
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
zoontek commented 1 year ago

The warning probably came from Expo code analysis, this package uses Android 12 SplashScreen API and there's no warning with bare React Native.