Android emulator command always log an error (Storing crashdata, detection is enabled for process...)
Asked Answered
P

3

18

I'm currently installing Android Studio on my Mac Mini M1 (after a factory reset), but I got an error using the emulator command (from android SDK), each time I run it, the first output line is the following error:

INFO    | Storing crashdata in: /tmp/android-gregoire/emu-crash-34.1.18.db, detection is enabled for process: 4832

For example:

> emulator -list-avds
INFO    | Storing crashdata in: /tmp/android-gregoire/emu-crash-34.1.18.db, detection is enabled for process: 4832
Pixel_3a_API_34

> emulator -help
INFO    | Storing crashdata in: /tmp/android-gregoire/emu-crash-34.1.18.db, detection is enabled for process: 4872
Android Emulator usage: emulator [options] [-qemu args]
  options:
    -list-avds                                                          list available AVDs
    -sysdir <dir>
[...]

So this is not related to any of the existing AVD (there is only a single AVD, but I got this error even if I remove it).

This is really painful because I develop using React Native who use the emulator -list-avds internally to start the first available AVD, but the react-native android command consider it should use the AVD named "INFO | Storing crashdata in: /tmp/android-gregoire/emu-crash-34.1.18.db, detection is enabled for process: 4832" that obviously doesn't exist.

Also when I go to the error folder /tmp/android-gregoire/emu-crash-34.1.18.db, there is nothing relevant, only empty folders attachments, completed, new, pending and a file settings.dat that contain sdPC����;A�$��ٽB`.

I have customised Android environment variables to use an external storage:

export ANDROID_HOME="/Volumes/GregDev/macmini/android/sdk"
export ANDROID_USER_HOME="/Volumes/GregDev/macmini/android/home"
export ANDROID_EMULATOR_HOME="/Volumes/GregDev/macmini/android/home"
export ANDROID_AVD_HOME="/Volumes/GregDev/macmini/android/home/avd"

And excepted the error with emulator, the installation appear to be workin: I can compile and run my react native app (I just need to launch the right emulator manually first).

My environment:

  • MacOS Sonoma 14.3.1 (Mac Mini M1)
  • emulator --version -> Android emulator version 34.1.18.0 (build_id 11481568) (CL:N/A)
  • Android Studio: Iguana 2023.2.1 (Build #AI-232.10227.8.2321.11479570)

I don't find any information on the internet about a related problem. Does anyone have any more information?

Thanks for help.

Petra answered 5/3 at 12:45 Comment(3)
Seems like expo folks as well as react-native users are seeing this: github.com/expo/expo/issues/27440Sustain
Same here, with emulator version 34.1.19.0Orison
Emulator version 34.1.20 hereThrips
S
27

Ok, this is what works for me on my mac:

Download Android Emulator (33.1.24) Stable from https://developer.android.com/studio/emulator_archive and overwrite the existing 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.

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

Sustain answered 6/3 at 3:3 Comment(7)
github thread with some more details about it: github.com/expo/expo/issues/27440#issuecomment-1980049767Sustain
version 33.1.24 fixed the issue for meBituminize
not working for me after doing this it shows unknown error troubleshoot. Help me me out plsAngora
Ver 3.1.24 also worked for me. Anyone know what's causing it?Febrifacient
How to download? I cannot see any download link...Steamer
@Steamer there are links below the instructions at developer.android.com/studio/emulator_archiveSustain
@Sustain weirdly enough there are no obvious links for me... I think there may be a bug, screenshot: ibb.co/fYCKDfw Btw I don't need to download this anymore, thanks for the help though :)Steamer
S
0

While a workaround made the trick for some of you as explained by NorseGaud, it doesn't seem to fix it for me.

Even if you're going back to an older version like the 33.1.24 through the emulator archive, Android Studio doesn't seem to detect the version you are using if you take a look at the SDK Manager - they even want you to update to the newest version. Android Studio not detecting it also means you can't boot a phone through the application, nevertheless you can do so through a terminal.

Also, if you're trying to go back to a Android Emulator 33 and you're trying to launch "react-native run-android", the command still says that no connected devices can be found. Metro can't reload the phone as the emulator can't be found by itself even if you started manually the emulator through "emulator -avd <device_name>".

I am not sure that only going back to an older Stable version fix it. Also the fact that Android Studio doesn't detect it and that you can't change the version through the SDK Manager feels a little pity.

As the update is really new and we are far from being the only ones, I really hope they just throw a fix for that "Storing crashdata" error. That would be the best fix.

Sherrell answered 7/3 at 21:22 Comment(1)
For me the workaround by NorseGaud works. And react-native run-android works again too.Veats
L
0

https://github.com/facebook/react-native/issues/43320#issuecomment-2011072921

这个方法很好用,下载这个压缩包之后,把压缩包解压到你的 \android\sdk 目录里,替换掉原来的emulator文件夹,然后重启电脑就可以了。👍👍👍

This method is very easy to use, after downloading this package, extract the package into your \android\sdk directory, replace the original emulator folder, and then restart the computer.👍👍👍

Liverwurst answered 21/3 at 2:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.