Open tausiq opened 3 years ago
I'm not sure I've seen this error before. Do you see something on the emulator or does it show a black screen and then crash? When you start the emulator does it report warnings or errors on the terminal? Are you using an Ubuntu virtual machine or a physical machine? My guess is that there might be issues with kvm or libvrt.
I've always worked on Ubuntu. I've never tried running the emulator on macOS.
Thanks!
The emulator shows a black screen and then crash. Sometime emulator shows the launcher briefly and then crash.
I have tried Ubuntu virtual + physical machine and macOS physical machine. I have enabled virtualization and kvm, without enabling kvm, the emulator couldn't be started at all, even Android Studio generated emulator.
Emulator reports warning and error on the terminal. Which warning/error messages would be more helpful, physical/virtual Ubuntu? Asking because I can try to get you the error messages from same configured machine that you have. Thanks!
One important observation, I was never able to run emulator by this command set,
cd android-emu
source build/envsetup.sh
lunch sdk_phone_x86-userdebug
emulator -writable-system
When I execute the command, emulator -writable-system
, I got an error asking me to build android before starting emulator.
I know you have already built Android in setup_emu.py
and the script executed successfully. I am not sure why I need to build again. So I used the following sequence,
cd android-emu
source build/envsetup.sh
lunch sdk_phone_x86-userdebug
m # Building Android, ref: https://source.android.com/setup/build/building
emulator -writable-system
Now the emulator attempts to start but crashes with a black screen as I mentioned. Assuming executing build command again won't cause any issues, is this a valid assumption?
Thanks for the information. I've only used a physical machine. In the past someone tried to run the Android emulator on a VM and switching to a physical machine solved some issues. I recommend using a physical machine first, if it is possibile.
Regarding the black screen, were you able to boot and use one of the emulators generated with Android Studio? See this link for example. Try to double check that your user is in the groups kvm and libvrt. The warnings / errors I'm referring to are the ones reported on the terminal when you launch the command emulator -writable-system
. This command reports errors related to virtualization and other issues.
Regarding the compilation issue, after running setup_emu.py
I was able to start the emulator without running other commands. Perhaps something failed during the compilation with the script compile_emu.sh
, but this failure was not reported by setup_emu.py
. Does the m
command that you added compile something and take a long time to run? I think it is safe to assume that recompiling shouldn't cause issues.
Thanks!
I have resumed the experiment and using physical machine.
Yes I can boot and run emulator using Android Studio. My user is in both kvm
and libvrt
Yes, m
command took a lot longer time to run.
I have been able to boot the emulator with following command,
emulator -writable-system -gpu swiftshader_indirect
It uses graphics: software
Thanks!
I use a Debian physical machine and I used -writable-system -gpu swiftshader_indirect
and my emulator has still not crashed for one day (and it's usually every hour).
I tried a lot of things but it seems to be a working solution!
Thanks!
I have used a fresh install of Ubuntu 18.04 and and followed the procedure mentioned in readme. When I execute
emulator -writable-system
, the emulator gets started but stops with Segmentation fault.I have also tried with macOS but it didn't help. Have you faced any similar issue? If yes, how do you resolve this?
Thanks in advance.