Failed to open /qemu.conf, err: 2
Asked Answered
A

6

21

I got this error while using windows command prompt to connect a android virtual device to visual studio code. However opens the android virtual device but still says no connected devices when run the flutter doctor command. please help to use a android virtual device for visual studio code.

Andras answered 27/12, 2019 at 20:31 Comment(0)
T
17

This error occur because there is a query for file in C:\qemu.conf path.

If you create a blank file the warning Failed to open /qemu.conf, err: 2 will desapear.

But in my tests, I needed to run as an administrator. (about this, look to the first comments above. Thanks for trick, Maikon Matheus)

This is the log in ProcessMonitor of Sysinternals:

ProcessMonitor of Sysinternals

Create the file with this command:

echo # > c:\qemu.conf

cmd.exe output

Telfer answered 26/5, 2020 at 15:23 Comment(1)
Thats works! Thanks!! To avoid the need of to run as an administrator, I added the Full control permission to Everyone in the created file.Fleck
S
15

This issue is resolved by Cold Boot, the command emulator -avd <avd_name> -no-snapshot-load, execute this on command prompt or terminal on Linux.

Make sure that emulator is added to system PATH.

Subserve answered 18/7, 2020 at 11:12 Comment(4)
'emulator' is not recognized as an internal or external command, operable program or batch file.Mechanotherapy
INFO | Android emulator version 31.2.10.0 (build_id 8420304) (CL:N/A) PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOTMechanotherapy
Check this answer here #48510624Subserve
another video here youtube.com/watch?v=MuerMz235DUSubserve
L
4

You have to fulfil android emulator requirements based on your system.

Android emulator requirements: https://developer.android.com/studio/run/emulator#requirements

My problem was missing this requirement:

reHAXM 6.2.1 or later (HAXM 7.2.0 or later recommended)

Solution was to go in Tools -> SDK Manager, and check Intel (HAXM installer) option.

enter image description here

Lupine answered 29/11, 2021 at 20:43 Comment(0)
P
1

I had the same error when ran

D:\Android>emulator -avd AndroidDevice01

The Problem was solved when I started cmd.exe with Administrative privileging!

Parquet answered 9/2, 2021 at 15:42 Comment(0)
D
0

I got the same error and problem after updating flutter and android studio. After updating my emulator didn't work correctly , it was asking me to use androidx when I ran "flutter run" command in vs code terminal . later I found this link to migrate my app to android x https://flutter.dev/docs/development/androidx-migration , this will provide you all the steps to do it.After doing that android studio will ask to update some more plugins please do it. Still you'll be getting the same error when opening your emulator using the cmd but the emulator will work fine and when you run flutter doctor it will show device connected.please make sure to run flutter doctor after running the emulator else it will show as not connected. Hope you understood what I said

Deming answered 1/1, 2020 at 18:17 Comment(0)
P
0

I also have exactly the same issue after updating Android SDK and Emulator to the latest version. And it doesn't look like it is related to Flutter (but I actually have it installed too). I posted this bug on issuetracker.google.com and provided all the logs. Hope they'll manage to help... P.S. I'll notify if they'll provide any solution.

Pyorrhea answered 7/1, 2020 at 12:45 Comment(1)
Do you have AMD CPU? If so, please, follow the steps in this article. There's a new Hypervisor for AMD CPUs only. androidstudio.googleblog.com/2019/12/…Pyorrhea

© 2022 - 2024 — McMap. All rights reserved.