Tanvir Rahman
Tanvir Rahman

Reputation: 709

Regarding GPU mode error in launching Android virtual device

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.....

Upvotes: 12

Views: 18651

Answers (4)

George Y.
George Y.

Reputation: 11779

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

Upvotes: 1

user3814327
user3814327

Reputation: 111

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.

Upvotes: 4

Milan Kerslager
Milan Kerslager

Reputation: 454

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.

Upvotes: 16

Xaikat
Xaikat

Reputation: 1

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.

Upvotes: 0

Related Questions