-->

Regarding GPU mode error in launching Android virt

2019-02-10 02:18发布

问题:

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:

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

回答1:

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.



回答2:

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.



回答3:

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.



回答4:

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