gpt4 book ai didi

Android 模拟器不工作 : Failed to open/qemu. conf,找不到加速器等等

转载 作者:行者123 更新时间:2023-12-05 01:58:14 24 4
gpt4 key购买 nike

Visual Studio Xamarin 再次出现问题。我目前有 Windows Pro 10.0.19043 和最新版本的 Visual Studio 2019 (16.10.4),其中包含以下组件:

Microsoft Visual Studio Enterprise 2019
Version 16.10.4
VisualStudio.16.Release/16.10.4+31515.178
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Enterprise
Microsoft Visual C++ 2019
ASP.NET and Web Tools 2019 16.10.526.50910
ASP.NET and Web Tools 2019
Azure App Service Tools v3.0.0 16.10.526.50910
Azure App Service Tools v3.0.0
C# Tools 3.10.0-4.21329.37+246ce641f04b67ef017655275d850bf902a8e40f
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Cookiecutter 16.10.21111.19
Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Extensibility Message Bus 1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info
Linux Core Dump Debugging 1.0.9.31313
Enables debugging of Linux core dumps.
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.113+g422d40002e.RR
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers 1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio 16.10.15 (552afdf)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.10.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
NVIDIA CUDA 11.0 Wizards 11.0
Wizards to create new NVIDIA CUDA projects and source files.
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Python 16.10.21111.19
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
Python - Profiling support 16.10.21111.19
Profiling support for Python projects.
Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 16.0.62106.24090
Microsoft SQL Server Data Tools
Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.
TypeScript Tools 16.0.30429.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.10.0-4.21329.37+246ce641f04b67ef017655275d850bf902a8e40f
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual C++ for Cross Platform Mobile Development (Android) 16.0.31306.167
Visual C++ for Cross Platform Mobile Development (Android)
Visual C++ for Linux Development 1.0.9.31313
Visual C++ for Linux Development
Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81
Microsoft Visual F# Tools
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions 1.0
View, manage, and diagnose containers within Visual Studio.
Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Foo 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
Xamarin 16.10.000.234 (d16-10@ecaf29b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.10.0.115 (remotes/origin/c750fbf1bde3c720d077f51640fe197c6dac7cbe@c750fbf1b)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.10.5 (355b57a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 11.3.0.4 (d16-10/ae14caf)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: b4a3858
Java.Interop: xamarin/java.interop/d16-10@f39db25
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.35.4@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0
Xamarin.iOS and Xamarin.Mac SDK 14.20.0.24 (c4b89cddb)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

已安装的 Android 平台: Platforms Android 11 Platforms Android 5

已安装的 SDK 组件: Shot 1 Shot 2 Shot 3

但是,无论我如何尝试为不同版本的 API 创建虚拟设备,模拟器都无法正常工作。从 Visual Studio 启动时,模拟器加载窗口会永远卡住(或卡住很长时间)。当通过命令行启动时,模拟器 (C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe) 产生了这个:

PS C:\Program Files (x86)\Android\android-sdk\tools> ./emulator -avd nexus_one_lollipop_5_0_-_api_21 
emulator: WARNING: encryption is off
ANGLE: D3D11: rx::Renderer11::generateConfigs
emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) ((null):0, (null))


emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))


Failed to open /qemu.conf, err: 2
Incompatible HAX module version 3,requires minimum version 4
No accelerator found.
qemu-system-i386.exe: failed to initialize HAX: Invalid argument

之后,qemu 进程永远挂起。在任务管理器中kill才结束。

-no-snapshot-load 选项对任何事情都没有影响。我以管理员身份运行所有程序,我也尝试以简单用户身份运行它 - 结果是一样的。

如果我创建一个 С:\qemu.conf 文件,那么输出会改变:

emulator: WARNING: encryption is off
ANGLE: D3D11: rx::Renderer11::generateConfigs
emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) ((null):0, (null))


emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))


qemu-system-i386.exe:/qemu.conf:1: no group defined
emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByName: No matching signal for on_posture_valueChanged(int) ((null):0, (null))

之后模拟器不再挂起,输出后立即退出。

我还想指出,另一个模拟器文件 (C:\Program Files (x86)\Android\android-sdk\emulator\emulator.exe) 产生的输出略有不同。我不明白为什么会这样以及它会影响什么。

PS C:\Program Files (x86)\Android\android-sdk\emulator> ./emulator -avd nexus_one_lollipop_5_0_-_api_21
emulator: WARNING: encryption is off
C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe:/qemu.conf:1: no group defined
PS C:\Program Files (x86)\Android\android-sdk\emulator>
  • 我尝试了其他类似问题的答案,但一切都保持不变。
  • 我已尝试重新安装 SDK 组件(先卸载,重新启动 PC,然后重新安装)。
  • 我尝试恢复 VIsual Studio(我不知道它做了什么,但在此过程中下载并安装了一些东西,并且重置了设置)。在导入旧设置之前,没有任何效果,就像导入之后一样。

现在我不知道该怎么办了。 下一步是重新安装 Windows,但它太长太无聊了,它需要很多设置 - 我现在还没准备好

很久没有用过Android开发了。似乎以前一切正常,但我不能说多久以前。也许某些组件的定期更新破坏了模拟器......顺便说一句,该项目正在成功组装。但是,我无法在我的 PC 上运行它。

是否可以在不重新安装 Windows 的情况下解决问题?怎么办?

最佳答案

我的问题原来是 Visual Studio 对 HAXM 什么都不做。是的,是他造成了主要的错误。如果你的错误输出和我的类似,那么重要的问题就出在HAXM上。

事实证明,从 Android SDK 菜单安装和卸载 HAXM(如问题中的屏幕截图所示)并不意味着在现实中安装或卸载。

正如我在问题中所说,之前一切都对我有用,但我很长一段时间都没有回到这个状态。所以,我安装了 HAXM,但是是旧版本。由于某种原因,Visual Studio 既不能更新也不能卸载它。安装新版本时,旧版本没有被替换并被认为是优先级,因此安装新版本而不删除旧版本无济于事。

如果您的旧 HAXM 安装程序(应该卸载旧 HAXM)不起作用,请继续阅读。那么,我是如何修复错误的:

  1. 通过 Android SDK 菜单“删除”HAXM。
  2. 检查了 设备管理器 中的 HAXM 条目(我没有在这里删除任何东西,因为我没有找到它)
  3. C:\Windows\System32\DRVSTORE\intelhaxm_* 中删除了旧的 HAXM 文件夹
  4. 启动了损坏的旧 HAXM 安装程序以删除 HAXM 注册表项。在人工干预之前,他不想工作,理由是缺少某种 .msi 文件。
  5. 重启电脑
  6. 我确保使用以下命令从系统中删除了旧的 HAXM:C:\Program Files (x86)\Android\android-sdk\emulator> .\emulator-check.exe accel
  7. 通过 Android SDK 菜单“安装”HAXM。 (在这一步,没有安装任何东西——上一步的命令仍然报告没有 HAXM。)
  8. 从 Intel 官方存储库安装了 HAXM:https://github.com/intel/haxm/releases
  9. 使用第 6 步中的命令,我确保正确安装了 HAXM(例如,显示了我 PC 上的输出):
PS C:\Program Files (x86)\Android\android-sdk\emulator> .\emulator-check.exe accel
accel:
0
HAXM version 7.7.0 (4) is installed and usable.
accel

之后,模拟器应该可以工作了。也许 Android 设备管理器 会出现故障,显示设备模拟器已经在运行(但我没有找到 qemu*emulator 进程)。也许,这可以更准确地解决,但我只是删除现有设备并重新创建它。

关于Android 模拟器不工作 : Failed to open/qemu. conf,找不到加速器等等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68674102/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com