-
Notifications
You must be signed in to change notification settings - Fork 907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android CLI fails to launch emulator automatically when running yarn android
#1801
Comments
Hi @UNIDY2002 thanks for reporting! Fix is on the way :) |
In my case the problem was not turned on virtualization in BIOS. So the expo probably was not able to start virtual Pixel device. You can check in Android Virtual Device Manager if you can run it. |
Still seeing this error. Same basic error to the original poster.
Note: Starting the emulator in Android Studio gets past this, but just wanted to report that the script to start is still encountering errors. |
Got 2 solutions from here and here it is working.
This bug came from the command line emulator -list-avds Now this command line add a new log at the first line :
The problem is that react-native take always the first emulator in this list as default emulator to launch. But now it try to open INFO | Storing crashdata in: /tmp/android-matthias/emu-crash-34.1.18.db, detection is enabled for process: 20206 that is not a emulator name, but just a log info. To launch the emulator, until a fix, you can still use the command line
then use the common command :
Download Android Emulator (version 33.1.24) Stable from Android Emulator Archive. This should help in resolving the emulator crashing issue on Android Studio. |
@Mynameisjohndev here are the direct links as shown on page SHA-256 Checksums |
@kadirmetin did you try the solution of @codewitharun |
Couldn't this utility just be fixed to ignore lines that start with INFO when parsing the emulator output..? |
The error is now only appearing occasionally for me using VSCode. No idea what is causing the intermittency. VSCode Version: 1.89.1 (user setup) |
You can fix this by changing the logic of the getEmulators function in the file node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/tryLaunchEmulator.js |
Is a simple way to solve it. Thanks! |
Environment
Additional information:
Description
After I execute
yarn android
, it prints an error message:I suspect there is something to do with this line: https://github.com/react-native-community/cli/blob/d351048/packages/cli-platform-android/src/commands/runAndroid/tryLaunchEmulator.ts#L27
When
port
is undefined, the subprocess parameters fall back to[`@${emulatorName}`, '', '']
, and the empty strings may be the cause of the problem.I think it is a regression, because it worked fine before I upgraded
react-native
to 0.71.Reproducible Demo
Suggestion for a fix
Change this line: https://github.com/react-native-community/cli/blob/d351048/packages/cli-platform-android/src/commands/runAndroid/tryLaunchEmulator.ts#L27
into:
The text was updated successfully, but these errors were encountered: