Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Emulator: cannot add library vulkan-1.dll: failed

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

like image 874
Sushant Kumar Avatar asked Jan 13 '21 05:01

Sushant Kumar


People also ask

What does Vulkan-1 DLL do?

dll is a critical system file for Windows OS. To be very precise, the vulkan-1. dll is mainly associated with Steam and PC games. The file is also known as Vulkan loader and is related to Vulkan Runtime.

How solve Android emulator closed because of internal error?

This error sometimes occurs because of out of date components like 'Android Emulator' or 'Android SDK Platform-Tools' components. Just update all pending updates, then Invalidate Caches & Restart, then try to create a new AVD.

How to disable Vulkan on Android emulator?

# 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 Show activity on this post. I think you don't have the JDK installed.

How to download and install Vulkan DLL?

The "vulkan-1.dll" can be found for example in the software "draw.io" (64 bit). The DLL is available in the installation folder. Show activity on this post. Go to Help -> Show Log in Explorer. Open idea.log file. Go to the bottom of the file. Download vulkan-1.dll from this. Extract and rename dll file names to vulkan-1.dll.

How do I import Vulkan samples into Android Studio?

Open Android Studio. Choose File > Open and select VulkanSamples/API-Samples/android/build.gradle. The Project pane resembles the window shown in Figure 1. Figure 1. Project pane displaying samples after they've been imported. You can compile your project in Android Studio or from the command line. Select File > Project Structure.

What hardware and platform version do I need to run Vulkan?

Before beginning, make sure you have the right hardware and platform version prepared. You should use a device that supports Vulkan, running Android API level 24 or higher. You can confirm your Android version by going to the Settings menu, and selecting About <device> > Android Version .


8 Answers

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
    
like image 30
Lee ABK Avatar answered Oct 23 '22 17:10

Lee ABK


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.

like image 54
FAQi Avatar answered Oct 23 '22 18:10

FAQi


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

like image 17
Armando Ávila Bueno Avatar answered Oct 23 '22 18:10

Armando Ávila Bueno


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
like image 9
5chw4hn Avatar answered Oct 23 '22 17:10

5chw4hn


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
like image 6
Patriotic Avatar answered Oct 23 '22 17:10

Patriotic


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.

like image 5
Oluwasegun Wahaab Avatar answered Oct 23 '22 17:10

Oluwasegun Wahaab


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

vulkan.lunarg.com/sdk/home

installer (1Mb)

like image 3
Adel Ben Hamadi Avatar answered Oct 23 '22 18:10

Adel Ben Hamadi


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.

like image 2
Vidalon Avatar answered Oct 23 '22 17:10

Vidalon