我在虚拟机来宾操作系统(Ubuntu 20.04.1(中运行Android Studio。来宾操作系统有4个处理器内核和8 GB RAM。KVM已启用:
$ egrep -c '(vmx|svm)' /proc/cpuinfo
4
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
Android工作室中的事件日志是空的,在控制台中我看到以下内容:CCD_ 1。我找到了几个有这样代码的帖子,并将Software
设置为Emulate performance graphics
,将VM Heap size
设置为512 MB
,但没有效果。
您找到解决方案了吗?对我来说,以下内容出现在Android Studio日志中:
2021-05-04 15:46:31,027 [79014767] INFO - manager.EmulatorProcessHandler - Emulator: /home/aj/Android/Sdk/emulator/emulator -netdelay none -netspeed full -avd Pixel_3a_XL_API_30
2021-05-04 15:46:31,248 [79014988] INFO - manager.EmulatorProcessHandler - Emulator: handleCpuAcceleration: feature check for hvf
2021-05-04 15:46:31,336 [79015076] INFO - manager.EmulatorProcessHandler - Emulator: cannot add library /home/aj/Android/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
2021-05-04 15:46:31,336 [79015076] INFO - manager.EmulatorProcessHandler - Emulator: added library /home/aj/Android/Sdk/emulator/lib64/vulkan/libvulkan.so
2021-05-04 15:46:31,336 [79015076] INFO - manager.EmulatorProcessHandler - Emulator: cannot add library /home/aj/Android/Sdk/emulator/lib64/vulkan/libvulkan.so.1: full
2021-05-04 15:46:31,394 [79015134] INFO - manager.EmulatorProcessHandler - Emulator: INTEL-MESA: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0
2021-05-04 15:46:31,394 [79015134] INFO - manager.EmulatorProcessHandler - Emulator:
2021-05-04 15:46:31,630 [79015370] INFO - manager.EmulatorProcessHandler - Emulator: emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: /run/user/1000/avd/running/pid_435941.ini
2021-05-04 15:46:44,682 [79028422] INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
2021-05-04 15:46:44,682 [79028422] WARN - manager.EmulatorProcessHandler - Emulator terminated with exit code 139
我会继续调查,我认为最近Ubuntu的更新可能破坏了一些东西。
编辑:没关系,我找到了解决我特定问题的方法:我正在测试另一个名为tivi的项目,该项目依赖于Android Studio Canary,并在模拟器中启动,一定也将模拟器更新为Canary版本(30.6.x版本(。之后,我回到我在Android Studio稳定版中的常规应用程序项目,并尝试使用任何模拟器映像,该映像总是给出关于";模拟器进程被终止";以及上面的日志消息。
我删除了所有没有帮助的模拟器图像。但刚才我尝试从SDK管理器重新安装android模拟器包。然后,它为AS稳定版安装了正确的版本:30.5.5。有了这个版本,模拟器又可以正常工作了。