Bare App Crash in Android release build due to Splash Screen
See original GitHub issueI have an app created with expo init bare minimum.
the splash screen seems to be causing a crash on the first load of a release build.
I did all the required steps for building and signing the app and when running npx react-native run-android --variant=release
(for testing purposes) the app builds, installs, loads but crashes exactly when the splash screen shows up.
Here’s the log:
05-30 12:44:18.897 17558 17558 E AndroidRuntime: FATAL EXCEPTION: main 05-30 12:44:18.897 17558 17558 E AndroidRuntime: Process: xxx.mypackage, PID: 17558 05-30 12:44:18.897 17558 17558 E AndroidRuntime: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child’s parent first. 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.addViewInner(ViewGroup.java:5958) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.addView(ViewGroup.java:5777) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.addView(ViewGroup.java:5717) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.addView(ViewGroup.java:5690) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at expo.modules.splashscreen.SplashScreenController$showSplashScreen$2.run(SplashScreenController.kt:33) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.app.Activity.runOnUiThread(Activity.java:6972) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at expo.modules.splashscreen.SplashScreenController.showSplashScreen(SplashScreenController.kt:32) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at expo.modules.splashscreen.SplashScreenController.showSplashScreen$default(SplashScreenController.kt:31) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at expo.modules.splashscreen.SplashScreenController$handleRootView$1.onChildViewRemoved(SplashScreenController.kt:116) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.dispatchViewRemoved(ViewGroup.java:5854) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:6506) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.view.ViewGroup.removeAllViews(ViewGroup.java:6445) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.clearReactRoot(ReactInstanceManager.java:723) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.tearDownReactContext(ReactInstanceManager.java:1112) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.runCreateReactContextOnNewThread(ReactInstanceManager.java:921) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.recreateReactContextInBackground(ReactInstanceManager.java:908) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.onJSBundleLoadedFromServer(ReactInstanceManager.java:896) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$200(ReactInstanceManager.java:125) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$2.onJSBundleLoadedFromServer(ReactInstanceManager.java:283) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.facebook.react.devsupport.DevSupportManagerImpl$24$1.run(DevSupportManagerImpl.java:1045) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.os.Looper.loop(Looper.java:237) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7860) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 05-30 12:44:18.897 17558 17558 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Here’s my environment info:
Expo CLI 3.20.9 environment info: System: OS: macOS 10.15.2 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.14.0 - /usr/local/opt/node@12/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/opt/node@12/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.4/11E146 - /usr/bin/xcodebuild npmPackages: expo: ~37.0.3 => 37.0.11 react: ~16.9.0 => 16.9.0 react-dom: ~16.9.0 => 16.9.0 react-native: ~0.61.5 => 0.61.5 react-native-web: ~0.11.7 => 0.11.7 react-navigation: ^4.3.9 => 4.3.9 npmGlobalPackages: expo-cli: 3.20.9
the device i’m running the app is a Samsung A10 - Android 10
Any help will be very much appreciated!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
same issue
I have the exact same problem, this causing me concern over the stability of expo libraries…