Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to launch emulator. Reason: Emulator exited before boot en React Native when react-native run-android

I am installing React Native according to this website https://medium.com/@leonardobrunolima/react-native-tips-setting-up-your-development-environment-for-windows-d326635604ea, it's very useful until I run the command react-native run-android, this is the error I receive:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Emulator exited before boot..
> Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
24 actionable tasks: 4 executed, 20 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> Could not read path 'C:\JesusApp\android\app\build\intermediates\transforms\mergeJniLibs\debug\0\lib\x86_64'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> Could not read path 'C:\JesusApp\android\app\build\intermediates\transforms\mergeJniLibs\debug\0\lib\x86_64'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

    at checkExecSyncError (child_process.js:629:11)
    at execFileSync (child_process.js:647:13)
    at runOnAllDevices (C:\JesusApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    

My node version is 10, and I am working on Windows, please help, thank you.

like image 995
Jesús Avatar asked Dec 27 '19 01:12

Jesús


Video Answer


2 Answers

  1. Check your config and environment setup with instructions here, be very careful with pathes set up. Check the $PATH from your IDE's terminal.
  2. check in the AVD that a particular Android OS is selected and installed for a virtual device you use (in my case it was not, I had yellow warning exclaim sign in an "Actions" column in an AVD's devices list).
  3. Have your Gradle updated to at least 6.6 in the

android/gradle/wrapper/gradle-wrapper.properties

  1. On Ubuntu after run I had to "push" switch-on button on the virtual device.

Finally, I got it up and running both on Windows 10 and Ubuntu 20.04 LTS with Android 30.

like image 95
Dmitry Avatar answered Sep 27 '22 16:09

Dmitry


I succeeded by doing the following steps: Open android studio > AVD Manager > Actions (click the bottom icon) > Select Cool Boot Now.

like image 27
Kartono bin Saleh Avatar answered Sep 27 '22 15:09

Kartono bin Saleh