Failed to open /qemu.conf, err: 2

[亡魂溺海] 提交于 2020-12-26 07:55:29

问题


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.


回答1:


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.

This is the log in ProcessMonitor of Sysinternals:

Create the file with this command:

echo # > c:\qemu.conf




回答2:


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.




回答3:


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




回答4:


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.



来源:https://stackoverflow.com/questions/59505749/failed-to-open-qemu-conf-err-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!