Search code examples
android-source

Android emulator failed to start after a successful aosp build


Follow the official build guide. I downloaded the master branch and built the aosp_arm-eng target. The build process was fine, but when I tried to start the emulator, it failed with the following logs:

.......
emulator: GPU emulation enabled using 'host' mode
emulator: Initializing hardware OpenGLES emulation support
emulator: VERBOSE: MultiDisplay.cpp:312: create display 0
emulator: VERBOSE: MultiDisplay.cpp:401: setDisplayPose 0 x 0 y 0 w 480 h 800 dpi 0
cannot add library /media/kevin/Data/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /media/kevin/Data/aosp/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
cannot add library /media/kevin/Data/aosp/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so.1: full
emulator: VERBOSE: load_config.cpp:242: Verified boot params were not found.
.......
emulator: Starting QEMU main loop
emulator: Adding boot property: 'ro.opengles.version' = '196609'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'both'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '512m'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '240'
qemu-system-aarch64: -chardev socket,port=46269,host=localhost,nowait,nodelay,ipv6,id=modem: Failed to connect socket: Connection refused
emulator: Done with QEMU main loop

I had searched around, and tried install some vulkan related packages.

I'd also tried to create an Android Virtual Device by using the built files,the avd just showed an empty black screen. But the AVDs created from the offical images works well on my computer.

System Info:

Ubunutu 20.04

CPU: 14-Core Intel Xeon E5-2680 v4 (-MT MCP-) speed/min/max: 1199/1200/3300 MHz Kernel: 5.4.0-58-generic x86_64 Up: 1d 23h 10m

Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Baffin [Radeon RX 550 640SP / RX 560/560X] driver: amdgpu v: kernel Display: x11 server: X.Org 1.20.8 driver: amdgpu resolution: 3840x2160~60Hz OpenGL: renderer: Radeon RX 560 Series (POLARIS11 DRM 3.35.0 5.4.0-58-generic LLVM 10.0.0) v: 4.6 Mesa 20.0.8


Solution

  • Don't use the master branch....this the bleeding edge branch and has many bugs...

    Try the released branches.