31

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

Kay
  • 17,906
  • 63
  • 162
  • 270

17 Answers17

34

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

nhoxbypass
  • 9,695
  • 11
  • 48
  • 71
17

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!

wal
  • 17,409
  • 8
  • 74
  • 109
Douglas
  • 479
  • 4
  • 7
11

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

dhiku
  • 1,818
  • 2
  • 22
  • 38
  • The version at time of writing this comment allows you to cold boot by pressing the drop down error and clicking 'cold boot now' – Mattwmaster58 May 06 '20 at 01:52
4

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

jatin rana
  • 825
  • 1
  • 9
  • 21
  • Yes this was the issue in my case, had to delete some avds images in C:\Users\UserNamed\.android\avd folder. It was the log Emulator: emulator: ERROR: Not enough space to create userdata partition. Available: 2606.636719 MB at C:\Users\UserName\.android\avd\Pixel_2_API_29.avd, need 7372.800000 MB. – shaby May 15 '20 at 15:52
2

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.

2

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

SMcDonald
  • 105
  • 2
  • 10
1

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.
Amir Raza
  • 2,320
  • 1
  • 23
  • 32
1

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

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.

e1347582
  • 11
  • 3
0

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.

Muaz Razaq
  • 11
  • 3
0

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

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

codepeaker
  • 420
  • 8
  • 15
0

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.

Drunken Daddy
  • 7,326
  • 14
  • 70
  • 104
0

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

Akbar
  • 71
  • 1
  • 3
0

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)

Kop3sh
  • 179
  • 3
  • 7
0

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

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.