I have a default react native project I installed from this turorial and I added a splash screen to my Project with this tutorial. However, now I get:
What is the best and most standard way to fix this problem? I need my splash screen for 1 secend and after that my app should start, I have read more articles but I couldn't find a fix for react native.
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
One of the reliable ways to fix the white screen of death on Android Phones or Tablets is to reboot your phone. First, press down the Power Button and Volume Down together, then tap on reboot. Once your phone reboot, it might result from a virus causing the Phone IOS not to load on time.
To change this, in your android/app/src/main/res/drawable folder create an image called splash. png . Then in splash_screen. xml change @mipmap/ic_launcher to @drawable/splash .
How to build a splash screen in React Native. First, head over to Appicon. Drag your image on the box provided, select 4x as your base size, select iOS and Android, and click generate. This process should take approximately two minutes to complete, depending on your internet speed.
I too have been through this problem. In my case it was redux persist library that use to extract persisted state from storage and feed it into the reducers and this process use to take almost 1 second during that second it used to show white screen a little flicker and then it renders the actual screen.
The work around i used is this actually the control to hide splash is on javascript side you are doing this to hide it.
componentDidMount() {
SplashScreen.hide();
}
Just add a little delay and it will work fine.
componentDidMount() {
setTimeout(() => SplashScreen.hide() , 2000);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With