react-native-splash-screen: [3.0.6] Crashes on Android

3.0.1 works on Android, but 3.0.6 causes an immediate crash. I can’t even open the app, it just pops up the crash alert. Logs don’t show anything useful, either:

$ react-native log-android
Scanning folders for symlinks in /Users/joncursi/Sites/joncursi/redbird-native/node_modules (29ms)
Starting the logger (/Users/joncursi/Library/Android/sdk/platform-tools/adb logcat *:S ReactNative:V ReactNativeJS:V)...
--------- beginning of main
--------- beginning of system
11-09 15:30:00.726  3099  3099 D ReactNative: [CodePush] Loading JS bundle from "assets://index.android.bundle"
11-09 15:30:00.727  3099  3099 D ReactNative: ReactInstanceManager.ctor()
--------- beginning of crash
11-09 15:30:50.816  3511  3511 D ReactNative: [CodePush] Loading JS bundle from "assets://index.android.bundle"
11-09 15:30:50.817  3511  3511 D ReactNative: ReactInstanceManager.ctor()

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 8
  • Comments: 19

Most upvoted comments

this is solved by creating the file: android/app/src/main/res/values/colors.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark"><!-- Colour of your status bar here --></color> </resources>

@ryam4u that also worked for me. I could not leave the color as an empty string so I added a transparent status bar.

I ended up with the in my android/app/src/main/res/values/colors.xml:

<?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#00ffffff</color> </resources>

My MainActivity.java is totally different

public class MainActivity extends ReactActivity {

  @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
      @Override
      protected ReactRootView createRootView() {
       return new RNGestureHandlerEnabledRootView(MainActivity.this);
      }
    };
  }

  /**
    * Returns the name of the main component registered from JavaScript.
    * This is used to schedule rendering of the component.
    */
  @Override
  protected String getMainComponentName() {
      return "AppName";
  }
}

Am I to remove the createReactActivityDelegate method in favour of onCreate? It doesn’t seem like they can co-exist.