Bare Workflow + Splash Screen: Error on reload

🐛 Bug Report

App reload crashes when expo-splash-screen is added.

When trying to restart the app via developer menu or hitting “r” on terminal the app crashes with following error.

Screenshot_2020-05-05-22-33-29-080_com miui bugreport

Environment

  • SDK 37 Bare Minimal Typescript Template
  • Installed and configured expo-splash-screen @ 0.1.1 and everything to do with showing and hiding the splash screen is working fine.
  • Running using npm run android

Steps to Reproduce

  • Start app in bare workflow with expo-splash-screen.
  • Reload app using either developer menu or “r” in terminal.

Expected Behavior

App bundler should restart.

Actual Behavior

App crashes.

Reproducible Demo

Will reply with demo when possible.

2 thoughts on “Bare Workflow + Splash Screen: Error on reload

  1. Running into the same error on a unimodules project. Was able to patch it by adding
    (splashScreenView.parent as? ViewGroup)?.removeView(splashScreenView)
    to SplashScreenController.kt before showing the splash screen, either in ShowSplashScreen or the handleRootView child removal listener. Looking into whether it affects bare-expo.

  2. Ditto. Thanks
    Here is what we did if it helps

      fun showSplashScreen(successCallback: () -> Unit = {}) {
        weakActivity.get()?.runOnUiThread {
          (splashScreenView.parent as? ViewGroup)?.removeView(splashScreenView)
          contentView.addView(splashScreenView)
          splashScreenShown = true
          successCallback()
          searchForRootView()
        }
      }