Search code examples
androidreact-nativeandroid-emulatorinfolaunching

React-Native expo wont launch Android Emulator (> Opening emulator INFO | Storing crashdata in: [...] /emu-crash-34.1.18.db)


This is a problem related to React-Native, AVDs and Android Emulators:

I just got a new MacBook Pro M3 pro and I am trying to create a new project using React-Native with Expo.

I have installed everything needed, Java SDK, Android Studio, Android SDK etc. Creating the project works. And if I launch the android emulator manually, I can also open the project on Android. However, if I don't launch the emulator manually, metro is not able to launch the emulator.

On my old macbook this used to work. When I pressed 'a' for open Android, it just launched the emulator by itself but now I get this:

metro not launching android emulator

this error tells me to launch emulator manually: /Users/miguel/Library/Android/sdk/emulator/emulator @INFO

I have no emulator named INFO.

However, if i run: emulator list-avd I get this:

AVD list

It seems to me that Metro is grabbing the first AVD from the list which happens to be this INFO thing, but it is not an AVD.

Also in /tmp/android-miguel/emu-crash-34.1.18.db there is nothing interesting, couple of empty folders and a settings.dat which no human readable content (no idea what this is)

content of emu-crash

Why Can't it launch the Emulator? What is that INFO thing? How can I solve this?

I have google this but I find no clues and chat gpt is not helping really. Every other thing I have tried didn't work -> Restart, reinstall Android Studio, change java version, restart after all that again, check paths for $PATH which by the way:

#SDK exporting export ANDROID_HOME=$HOME/Library/Android/sdk

#Tools exporting export PATH="$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools" export ANDROID_AVD_HOME=~/.android/avd

(I had it before like this:

export ANDROID_HOME="/Users/<user_name>/Library/Android/sdk" export ANDROID_TOOLS="/Users/<user_name>/Library/Android/sdk/tools/" export ANDROID_PLATFORM_TOOLS="/Users/<user_name>/Library/Android/sdk/platform-tools/" PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS echo $PATH

but then there were repeated entries in the path and chat-gpt told me to change it as I posted above)

I have been trying to solve this for 2 days now and I am out of ideas and knowledge... please help me.

Currently I am using Node 21, Java 17, expo 0.17.6, Android SDK 33 with tiramisu, I have an AVD (Pixel 7 with API 34)

There is someone who seems to have a similar problem but using Android Studio However the presented solution didn't work for me.

HELP!!!

PS: I tried a different project using yarn but it has the same problem.


Solution

  • Posting a solution here too:

    Download Android Emulator (33.1.24) Stable from https://developer.android.com/studio/emulator_archive and overwrite the existing emulator folder in ~/Library/Android/sdk (if that's where your sdk is).

    Run emulator -list-avd manually, confirm the macOS permissions in System Preferences, and then run it a second time to see the INFO log line gone. You may also need to run xattr -dr com.apple.quarantine emulator, but I didn't need to.

    IF for some reason this doesn't work, go back to an older Stable release from that page.