34

When I run the emulator from Android Studio in Windows 10 Pro 64-bit, then it shows the below error:

13-01-2021
10:42 AM    Emulator: handleCpuAcceleration: feature check for hvf

10:42 AM    Emulator: cannot add library vulkan-1.dll: failed

10:42 AM    Emulator: cannot add library vulkan-1.dll: failed

10:42 AM    Emulator: Process finished with exit code -1073741819 (0xC0000005)

And the emulator is not opening. I've uninstalled the current version (4.1.1) and installed 4.0.1 of Android Studio, but problem is not solved. Now I'm in the latest version of Android Studio i.e., 4.1.1.

Here is output of flutter doctor:

Flutter doctor output Image

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sushant Kumar
  • 479
  • 1
  • 6
  • 14
  • 2
    Check previous solution on SO: https://stackoverflow.com/questions/58391908/android-studio-emulator-is-not-working-on-windows-7/58392200 . In a nutshell you should try to change graphic settings for your emulator. – fartem Jan 13 '21 at 07:59
  • 3
    when I creating new emulator with android 11 then graphics option is set to automatic and not changeable. But when I created with android 6 then graphics option is changeable and when I changed to Software - GLES 2.0 then Emulator is Working. – Sushant Kumar Jan 13 '21 at 09:06
  • You can manually change graphics type for the emulator. For more information see https://stackoverflow.com/questions/58152237/android-studio-emulator-vk-version-1-1-check-failed/59715169#59715169 – fartem Jan 13 '21 at 09:36
  • I’m voting to close this question because it breaks multiple rules. It includes a link to 'the solution' edited in later, without any explanation. OP could have written an answer instead of editing the question, but even then a link-only answer would have been violating the guidelines. – Stijn de Witt Jul 09 '21 at 10:24
  • 100% working answer https://professnow.com/blog/solved-emulator-cannot-add-library-vulkan-1-dll-failed/ – Sushant Kumar Aug 03 '21 at 11:59

13 Answers13

33

I don't know whether Microsoft Visual Studio Code (VS Code) itself needs vulkan-1.dll or any of my following Visual Studio Code extensions,

enter image description here

as I found out that you may find the missing vulkan-1.dll at Visual Studio Code's following folder path:

C:\Users\{your_username}\AppData\Local\Programs\Microsoft VS Code\

So, if you have Microsoft Visual Studio Code installed, you may find the vulkan-1.dll at the above-quoted path. From here, just copy the vulkan-1.dll file, and paste that in folder:

C:\Users\{your_username}\AppData\Local\Android\Sdk\emulator\lib64\

After pasting the file, restart Android Studio and rerun the emulator/AVD.

FAQi
  • 865
  • 1
  • 13
  • 21
26

I have had this problem since update v30.7.5.

I tried this solution:

  1. Create the file ~/.android/advancedFeatures.ini (for Windows users path should be C:\Users<username>.android\advancedFeatures.ini) with the following content:

    Here's how to disable Vulkan apps to talk to the emulator. Add the following lines to ~/.android/advancedFeatures.ini (create this file if it doesn't exist already):

    Vulkan = off
    
    GLDirectMem = on
    
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Lee ABK
  • 361
  • 3
  • 6
  • Thank you! Your solution is perfect. But what did you mean by "Now it has been resolved."? Are there any updates released after v30.7.5? I couldn't see any. – Sergey Stasishin Jul 29 '21 at 11:50
  • My Pixel4/API 30 AVD emulator *USED* to work ... until I recently updated to Android Studio 4.2.2, and updated the SDK tools. I tried EVERYTHING ELSE on this page, but creating `.android\advancedFeatures.ini` was the only thing that actually worked for me. Thank you!!!! PS: "emulator -version" => `30.7.5.0 (build_id 7491168)` – paulsm4 Aug 09 '21 at 00:23
  • Note that you need to create `advancedFeatures.ini`, not `advancedFeatures.ini.txt` so you must use text and source code editor software like Notepad++ for example, and then save as ini – Mohamed Ben Romdhane Jan 12 '22 at 12:26
  • Thanks mate! I was struggling with this for so long. – dagra Apr 30 '23 at 12:18
17

I got the same error yesterday, when I installed the latest version of Android Studio (4.2.2 on the stable channel). Every time I tried to start an Emulator I got a warning saying that "The emulator process for AVD was killed", after looking the IDE's Log, I found this:

2021-07-01 18:00:48,415 [  62545]   INFO - manager.EmulatorProcessHandler - Emulator: cannot add library vulkan-1.dll: failed
2021-07-01 18:00:48,415 [  62545]   INFO - manager.EmulatorProcessHandler - Emulator: cannot add library vulkan-1.dll: failed
2021-07-01 18:00:48,668 [  62798]   INFO - manager.EmulatorProcessHandler - Emulator: emulator: Android emulator version 30.7.5.0 (build_id 7491168) (CL:N/A)
2021-07-01 18:00:48,676 [  62806]   INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code -1073741819 (0xC0000005)
2021-07-01 18:00:48,676 [  62806]   WARN - manager.EmulatorProcessHandler - Emulator terminated with exit code -1073741819

I tried every "solution" I could find but nothing worked until I downloaded vulkan-1.dll and placed it in C:\Windows\System32

Just go to Google and search for vulkan-1.dll file, download it and place it in C:\Windows\System32

  • 1
    I faced this same issue after updating my android studio to 4.2.2. And now following your instructions but it is still throwing the same error. handleCpuAcceleration: feature check for hvf cannot add library vulkan-1.dll: failed cannot add library vulkan-1.dll: failed – Muneeb Hassan Jul 17 '21 at 08:52
  • 1
    I downloaded the file and pasted it in C:\Windows\System32 as mentioned. The file name is vulkan-1.dll and still getting the same error. – era s'q Jul 28 '21 at 15:11
9

Armando's answer is a solution that works. But I don't feel comfortable packing arbitrary DLL files from the Internet into the System32 folder.

However, based on Armando's solution, I have found a way in which I feel more comfortable - however, it remains a workaround:

  1. The "vulkan-1.dll" can be found for example in the software "draw.io" (64 bit). The DLL is available in the installation folder.
  2. Copy the DLL into {ANDROID_HOME}\emulator\lib64\
  3. Start Android Studio and try out the AVD
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
5chw4hn
  • 341
  • 3
  • 5
6

Error:

  1. Go to Help -> Show Log in Explorer.
  2. Open idea.log file.
  3. Go to the bottom of the file.
  4. Found: "Emulator: cannot add library vulkan-1.dll: failed"

Solution:

  1. Download vulkan-1.dll from this.
  2. Extract and rename dll file names to vulkan-1.dll.
  3. Paste it in C:\Windows\System32
Patriotic
  • 2,103
  • 4
  • 26
  • 36
  • 1
    That's fixed my issue, thank you very much (I've spent the whole evening trying fix it)!! Special thanks for vulkan-1.dll link. (Btw, changing graphic to shoftware, as was mentioned in other posts helped to fix issue for older Phones in simulator, but Pixel4a, for ex, started working only after adding of vulkan-1.dll). – TOL Aug 07 '21 at 23:27
  • Download and use a DLL file from some random place on the Internet? How can this file be trusted? – Peter Mortensen Sep 08 '21 at 20:26
5

Four steps.

  1. Download the vulkan DLL file from the Internet or get it from any comfortable source.
  2. Extract the DLL file
  3. Place it in c\Users\[your username]\AppData\Local\Android\Sdk\emulator\lib64.
  4. Then rename the file to 'vulkan-1.dll'

Then run your emulator and see it come up.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Oluwasegun Wahaab
  • 2,663
  • 3
  • 16
  • 19
  • I faced this same issue after updating my android studio to 4.2.2. And now following your instructions but it is still throwing the same error. handleCpuAcceleration: feature check for hvf cannot add library vulkan-1.dll: failed cannot add library vulkan-1.dll: failed – Muneeb Hassan Jul 17 '21 at 08:54
3

For me, the solution was as described in this Microsoft forum.

Create a file under your .android directory called advancedFeatures.ini and add these two variables:

Vulkan = off
GLDirectMem = on

More information on Vulkan support for Windows and Linux can be found here.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Vidalon
  • 39
  • 1
  • This worked for me on Mac. I had to restart Android studio (and the React Native app too) – ow3n Aug 12 '23 at 17:11
3

look for vulkan runtime installer instead of copying vulkan-1.dll in system32

vulkan.lunarg.com/sdk/home

installer (1Mb)

Adel Ben Hamadi
  • 720
  • 10
  • 13
0

If you are running xamarin.android in Visual Studio, I strongly recommend uninstall all device simulators and restart Visual Studio and then running your app again.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

I have encountered the same problem where emulator.exe ended abruptly with the same lines on the console. After hours of experiment, downgrading the emulator version from Android Emulator 3.7.5 to 30.4.5.0 (build_id 7140946) worked.

I don't think this should be the error vulkan-1.dll is the reason for the process to end abruptly. I am saying this because my logs from a successful run on 30.4.5.0 (build_id 7140946) also showing this dll missing error but continued and the emulator showed up successfully.

emulator: Android emulator version 30.4.5.0 (build_id 7140946) (CL:N/A)
handleCpuAcceleration: feature check for hvf
emulator: WARNING: Your GPU drivers may have a bug. If you experience graphical issues, please consider switching to software rendering.
cannot add library vulkan-1.dll: failed
cannot add library vulkan-1.dll: failed
Failed to open /qemu.conf, err: 2
Windows Hypervisor Platform accelerator is operational
dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `goldfish_audio_in'
e:\Users\user\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: warning: opening audio input failed
emulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
dsound: Attempt to initialize voice without DirectSoundCapture object
dsound: Attempt to initialize voice without DirectSoundCapture object
audio: Failed to create voice `adc'
Your emulator is out of date, please update by launching Android Studio:
 - Start Android Studio
 - Select menu "Tools > Android > SDK Manager"
 - Click "SDK Tools" tab
 - Check "Android Emulator" checkbox
 - Click "OK"

emulator: INFO: boot completed
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: Revoking microphone permissions for Google App.

FYI. I am running an emulator in a nested VM on the Hyper-V platform and my GPU version is:

android_startOpenglesRenderer: gpu info

GPU #1
  Make: 1414
  Model: Microsoft Basic Render Driver
  Device ID: 008c
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Vinit Siriah
  • 327
  • 3
  • 12
  • Hey @peter-mortensen - I'm also trying to run the emulator in a nested VM on the Hyper-V platform and I am also struggling. One notable thing about downloading old emulator versions is that it requires a specific dl.google.com URL, for example (but not the version you mention): https://dl.google.com/android/repository/emulator-windows-6855416.zip - do you have a link for a version that is working for you now? – Mike Hardy Jan 05 '22 at 14:37
0

With the following Android SDK and Tooling:

SDk Tools Setup

SDK Platforms Setup

SDK Folder Structure

I have the above directory structure for the SDK and I have a folder for the vulkan drivers as you can see above. I was able to copy the file: vk_swiftshader.dll to the parent lib64 directory, rename it to vulkan-1.dll to solve the problem

saycat
  • 11
  • 3
0

In my case this happened after I installed Visual Studio Code. And the error log is WARN - Emulator: Pixel 4 API 30 - Please update the emulator to one that supports the feature(s): Vulkan,
So I've just updated the emulator Graphics setting to Software: enter image description here

-2

Downgrade the emulator android API version, I was using at API 30 I downgraded it to API28 and emulator starts working