question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bare App Crash in Android release build due to Splash Screen

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
altssolutioncommented, Jun 20, 2020

same issue

0reactions
TrustyTechSGcommented, Jul 10, 2020

I have the exact same problem, this causing me concern over the stability of expo libraries…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo React Native Bare release APK crashing immediatly ...
When i start de app in my real device, the app crash (stopped working) before the splash screen. I release all architecture APKs, ......
Read more >
App is stuck on Splash screen - Expo Development Tools
From March 21 2022 onwards the builds pushed to TestFlight and Google Play are not working. The app is stuck on the splash...
Read more >
Attempt to add splash screen crashes app and results in two ...
With the splash screen code line in the manifest file (<category android:name="android.intent.category.LAUNCHER" />) uncommeted, the app crashes and I have TWO ...
Read more >
iOS works in Debug but mono crashes at splash screen in ...
* VS version updated * Xamarin updated * Some Nugets updated. It all still runs (on all my devices) in debug mode, but...
Read more >
Building a splash screen in React Native
Learn how to build a splash screen in React Native for both iOS and Android apps, and edit its features, like background color....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found