Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVD emulator not working in Android Studio (Could not initialize OpenglES emulation)

I am a beginner in developing Android apps. I just installed Android Studio on my laptop and when I try to open an AVD, the following error appears:

emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.

Here is the full log of the error:

Creating filesystem with parameters:

could not get wglGetExtensionsStringARB

Size: 69206016
Block size: 4096

could not get wglGetExtensionsStringARB

Blocks per group: 32768 could not get wglGetExtensionsStringARB

Inodes per group: 4224 could not get wglGetExtensionsStringARB
Inode size: 256 could not get wglGetExtensionsStringARB

could not get wglGetExtensionsStringARB

Journal blocks: 1024
Label:  could not get wglGetExtensionsStringARB

Blocks: 16896 could not get wglGetExtensionsStringARB

Block groups: 1 getGLES1ExtensionString: Could not find GLES 1.x config!

Reserved block group size: 7 Failed to obtain GLES 1.x extensions string!

Created filesystem with 11/4224 inodes and 1302/16896 blocks

Could not initialize emulated framebuffer

emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.

I have tried to reduce the resolution, RAM and change the device but nothing seems to work. Please advice.

UPDATE: The AVD is powering up when I uncheck the host GPU option but it is working really slowly.

like image 989
Varun Wahi Avatar asked Jun 08 '15 09:06

Varun Wahi


1 Answers

First, let's explain the problem:

Could not initialize OpenglES emulation, use '-gpu off' to disable it.

This means that the Android Emulator tries to use OpenglES, but it does not work. OpenglES is needed for rendering 2D and 3D computer graphics.

There are 2 ways to resolve the issue:

1) install an OpenGL implementation

e.g. on Ubuntu 16.04, I have installed Mesa

sudo apt-get install mesa-utils

then rebooted the PC and it worked!

2) use Software GLES2.0

in your Virtual Device set Emulated Performance - Graphics to "Software GLES 2.0": configure the Android Virtual Device to use Software GLES2.0

The first approach is recommended, because it has better performance.

like image 195
TmTron Avatar answered Nov 08 '22 15:11

TmTron