Regarding GPU mode error in launching Android virt

2019-02-10 02:41发布

When I am trying to launch Android virtual device in Android Studio 2.0, it is giving me following error.

ERROR: Invalid GPU mode 'mesa', use one of: on off host guest

A screen shot is given bellow related to this error: Error

Any help would be greatly appreciated!Thanks.....

4条回答
时光不老,我们不散
2楼-- · 2019-02-10 02:44

A one-liner to disable GPU for all installed AVDs:

find  ~/.android/avd/ -name config.ini | while read f; do sed -ibak 's/hw.gpu.mode=.*/hw.gpu.mode=off/' "$f"; done
查看更多
你好瞎i
3楼-- · 2019-02-10 02:59

Go to Virtual device manager, click 'Show on Disk' in the menu of the Virtual device. Open the config.ini file and change the respective line to: hw.gpu.mode=guest Then save the config.ini and then run Virtual device again. It should work.

查看更多
贼婆χ
4楼-- · 2019-02-10 03:02

I got the same error. As a work-around I created another virtual device (AVD) with the same configuration and then used that device as my Emulator. That fixed it. Click on the "Create Virtual Device" button shown in the screenshot.

You can also try changing the configuration of the virtual device to find which one works best for your app.

查看更多
聊天终结者
5楼-- · 2019-02-10 03:05

I had the same error and what worked for me was : Open AVD manager as in the screenshot in the question. Then click on Edit this AVD on the right. After the configuration window opens, there is a setting for Graphics in Emulated Performance. I set it to Auto which solved the error for me.

查看更多
登录 后发表回答