Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio AVD - Emulator: Process finished with exit code 1

I'm having trouble starting my android emulator. Nothing appears to load.

Pixel 2 API 26 Android 8.0 x86.

Linux Ubuntu 16.04 LTS 64-bit.

12/10/17 2:20 PM Emulator: libGL error: unable to load driver: vmwgfx_dri.so

2:20 PM Emulator: libGL error: driver pointer missing

2:20 PM Emulator: libGL error: failed to load driver: vmwgfx

2:20 PM Emulator: libGL error: unable to load driver: swrast_dri.so

2:20 PM Emulator: libGL error: failed to load driver: swrast

2:20 PM Emulator: X Error of failed request: BadValue (integer parameter out of range for operation)

2:20 PM Emulator: Major opcode of failed request: 155 (GLX)

2:20 PM Emulator: Minor opcode of failed request: 24 (X_GLXCreateNewContext)

2:20 PM Emulator: Value in failed request: 0x0

2:20 PM Emulator: Serial number of failed request: 33

2:20 PM Emulator: Current serial number in output stream: 34

2:20 PM Emulator: Process finished with exit code 1

like image 700
Kay Avatar asked Dec 10 '17 14:12

Kay


People also ask

How do I exit Android Emulator?

To stop a running emulator, click Menu and select Stop.

Why is my AVD not working?

In case you get an error like "Intel virtualization technology (vt,vt-x) is not enabled". Go to your BIOS settings and enable Hardware Virtualization. 3) Restart Android Studio and then try to start the AVD again.

Why AVD Manager is not working?

SDK Build Tools are not installed If it fails then you may have to install it again. You look at the build tab at the bottom of the screen, it will display the error message and option to install the Build tools. Install it and you should be able to see the AVD Manager. Another way is to go to the SDK Manager.


2 Answers

These are known errors from libGL and libstdc++

You can quick fix this by change to use Software for Emulated Performance Graphics option, in the AVD settings.

Or try to use the libstdc++.so.6 (which is available in your system) instead of the one bundled inside Android SDK. There are 2 ways to replace it:

  • The emulator has a switch -use-system-libs. You can found it here: ~/Android/Sdk/tools/emulator -avd Nexus_5_API_23 -use-system-libs.

    This option force Linux emulator to load the system libstdc++ (but not Qt libraries), in cases where the bundled ones (from Android SDK) prevent it from loading or working correctly. See this commit

  • Alternatively you can set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system.

    This has the benefit of making sure that the emulator will work even if you launched it from within Android Studio.

See: libGL error and libstdc++: Cannot launch AVD in emulator - Issue Tracker

like image 192
nhoxbypass Avatar answered Sep 25 '22 07:09

nhoxbypass


This works to me:

click in Sdk manager in SDK Tools and: enter image description here

Unistal and install the Android Emulator: enter image description here

Hope to help!

like image 26
Douglas Avatar answered Sep 22 '22 07:09

Douglas