27
votes

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

17

17 Answers

31
votes

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

13
votes

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!

11
votes

In AVD Manager -> Edit -> Show Advanced Settings -> Boot Options (Selct Cold boot). That fixed my issue

4
votes

Check android studio event log as it could be low storage issue.

emulator: ERROR: Not enough disk space to run AVD 'Nexus_5_API_21'. Exiting...

2
votes

Android make the default avd files in the C:\Users\[USERNAME]\.android directory. Just make sure you copy the avd folder from this directory C:\Users\[USERNAME]\.android to C:\Android\.android. My problem was resolved after doing this.

1
votes

My issue resolved

  • May be you do not have enough space to create this virtual device (like in my case). if this happens, try to create space enough for this Virtual device.

OR

  • Uninstall and re-install can solve this issue.

OR

  • Restarting Android Studio can solve.
1
votes

Open AVD manager and click on the drop down along side with your emulator and select the show in disk and delete the file with .lock extension. After deleted, run your emulator. That works for me.

1
votes

For me there was a lack of space on my drive (around 1gb free). Cleared away a few things and it loaded up fine.

0
votes

Go To AVD Manager, Click On The "Down Arrow" Next to The AVD Device that is showing this error, Click on "Show on Disk". Now Delete These Two Files "Cache.img" & "cache.img.qcow2" ..

Works Perfectly Fine For me.

0
votes

There might be several reasons for this.

  1. first of all, check whether the legacy mode is enabled in your bios settings. if it is not enabled, ensure to make it enabled in BIOS settings.
    1. and then In AVD Manager -> Edit -> Show Advanced Settings -> Boot Options (Select Cold boot). That fixed my issue. I hope it will fix your problem.
0
votes

Sometimes things need a system restart (in my case).

0
votes

None of the solutions worked for me. I ended up downloading a different emulator image.

First I had arm64-v8a, which was giving this error. I download armeabi-v7a, which worked fine.

Unfortunately I was not able to install HAXM accelerator as organization's softwares were blocking the installation. Hence, had to go with arm.

0
votes

I had same issue for windows , the cause of the problem was currupted or missing dll files. I had to change them.

In android studio ,

Help Menu -> Show log in explorer.

It opens log folder, where you can find all logs . In my situation error like "Emulator terminated with exit code -1073741515"

  1. Try to run emulator from command prompt ,
  • Go to folder ~\Android\Sdk\emulator

  • Run this command:

    emulator.exe -netdelay none -netspeed full -avd <virtual device name> 
    
    ex: emulator.exe -netdelay none -netspeed full -avd Nexus_5X_API_26.avd
    

    You can find this command from folder ~.android\avd\xxx.avd\emu-launch-params.txt

  1. If you get error about vcruntime140 ,
  • Search and download the appropriate vcruntime140.dll file for your system from the internet (32 / 64 bit version) , and replace it with the vcruntime140.dll file in the folder ~\Android\Sdk\emulator

  • Try step 1

  • If you get error about vcruntime140_1 , change the file name as vcruntime140_1.dll ,try step 1

  1. If you get error about msvcp140.dll
  • Search and download the appropriate msvcp140.dll file for your system from the internet (32 / 64 bit version)
  • Replace the file in the folder C:\Windows\System32 with file msvcp140.dll
  • Try step 1

If it runs , you can run it from Android Studio also.

0
votes

This can be solved by the following step:

Please ensure "Windows Hypervisor Platform" is installed. If it's not installed, install it, restart your computer and you will be good to go.

enter image description here

0
votes

I am using flutter and installed virtual device using the terminal

flutter emulator --launch {avd_name} -v

will print a more detailed output, making it easier for debugging the specific errors

Enabling the virtualization options in BIOS worked in my particular case (VDT)

0
votes

I had the same issue, tried multiple times to uninstall, reinstall Android studio. I had error while launching the Studio where </Users/Youruserid/Library/Application Support/Google/AndroidStudio4.1> directory had permission issue. I tried to run Studio with Sudo, so launch of Studio worked but error Home "Android Studio AVD - Emulator: Process finished with exit code 1"

Problem: Directory never existed </Users/Youruserid/Library/ApplicationSupport/Google/AndroidStudio4.1>

Solution:

  1. Created missing directory, "sudo" required to create below dirs </Users/youruserdir/Library/Application Support/Google/AndroidStudio4.1>

  2. Once created, change owner of the created dirs from root user to

  3. Change owner from root to for all dirs shown in screenshot

    sudo chown -R <YourUserId> 'Chrome Canary'

    Directories

  4. Relaunch Studio and it should work fine.

0
votes

Solution that works for me my Android Emulator API level is 30 so I downrade this to 28 and it works like a charm. I hope this trick is beneficial to anyone.