Not able to run android studio - android-studio

I'm not able to run my "Hello World" application in android studio and shows the following error:
19:38 Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!
19:38 Emulator: Process finished with exit code 1
I have checked in my Android SDK manager,intelX86 Emulator Accelerator(HAXM installer) was installed.
How can i clear this bug?

Related

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:
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,
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.
I have had this problem since update v30.7.5.
I tried this solution:
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
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
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:
The "vulkan-1.dll" can be found for example in the software "draw.io" (64 bit). The DLL is available in the installation folder.
Copy the DLL into {ANDROID_HOME}\emulator\lib64\
Start Android Studio and try out the AVD
Error:
Go to Help -> Show Log in Explorer.
Open idea.log file.
Go to the bottom of the file.
Found: "Emulator: cannot add library vulkan-1.dll: failed"
Solution:
Download vulkan-1.dll from this.
Extract and rename dll file names to vulkan-1.dll.
Paste it in C:\Windows\System32
Four steps.
Download the vulkan DLL file from the Internet or get it from any comfortable source.
Extract the DLL file
Place it in c\Users\[your username]\AppData\Local\Android\Sdk\emulator\lib64.
Then rename the file to 'vulkan-1.dll'
Then run your emulator and see it come up.
look for vulkan runtime installer instead of copying vulkan-1.dll in system32
vulkan.lunarg.com/sdk/home
installer (1Mb)
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.
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
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.
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
Downgrade the emulator android API version, I was using at API 30 I downgraded it to API28 and emulator starts working

Cannot open emulator in android studio

I am using the android studio. I cannot open the emulator from the emulator. When I run the emulator it comes out the error:
Emulator: emulator: ERROR: Unknown AVD name [Pixel_API_27], use -list-avds to see valid list.
Emulator: Process finished with exit code 1
Anyone know how to solve it?
control if you activated virtualization from bios
if you have amd processor you need to follow some steps to use it with full compability, check for that from YouTube.
If you already did those steps, just uninstall all about avd and install them again.
I guess you haven't installed the AVD correctly.
You will see the valid list with:
-list-avds
Or you can install AVDs at Tools > AVD Manager.

Emulator error in starting Androir Studio 3.0.1

I am new with Android Studio (3.0.1) so the first thing i did was creating a new virtual device.
After that, i tried running an app with my new virtual device but it gives me this error :
Emulator: Process finished with exit code 1.
Emulator: emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Can someone tell me what is needed?
Try another version of android studio, maybe your hardware can’t support 3.0.1
I encountered the same problem on 3.0.1 , i've switched to 3.2.0 and it worked.

Emulator: failed to initialize WHPX: Function not implemented

While trying to run the emulator on the android studio I am getting the following error
Emulator: Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
Emulator: failed to initialize WHPX: Function not implemented
Emulator: Warning: requested RAM 1536M too high for your system. Reducing to maximum supported size 512M
Emulator: qemu-system-x86_64.exe: Could not load library WinHvPlatform.dll.
while running the emulator I am getting Notification as
Emulator: Process finished with exit code 0
enter code here
Emulator: failed to initialize WHPX: Function not implemented
This is my first time using the android studio.Please some one help me.
Had the same error that "Emulator: failed to initialize WHPX: Function not implemented"
Updated Android Emulater to latest update and Android SDK Platform-Tools
I found that it was simply not installed, for whatever reason.
To add it to the Android Studio installation, go to Tools->Android->SDK Manager, select the SDK Tools tab, then ensure that Android Emulator is selected.

Android studio,, AVD emulator

I have a problem with avd emulator. It wont start, I try everything and it still doesn't work. Here is the problem:
"D:\Android SDK\tools\emulator.exe" -avd Slim_Shady_API_22 -netspeed full -netdelay none distrib/android-emugl//host/libs/Translator/GLES_V2//GLESv2Imp.cpp:glAttachShader:187 error 0x501 distrib/android-emugl//host/libs/Translator/GLES_V2//GLESv2Imp.cpp:glAttachShader:187 error 0x501 TextureDraw: Could not create/link program:
emulator: device fd:584
HAX is working and emulator runs in fast virt mode
ERROR: Could not create window texture: Texture dimensions are limited to 2048x2048
Error accepting connection, aborting
1) Install the Intel x86 Emulator Accelerator (HAXM installer) from the Android SDK Manager
2) Run (for Windows):
{SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
or (for OSX):
{SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager\IntelHAXM_1.1.1_for_10_9_and_above.dmg
3) Start the emulator
If you own an android phone or tablet, then you can install the .apk of your app on it. You can find the apk here AndroidStudioProjects\AppName\app\build\outputs\apk\app-debug.apk

Resources