如何解决如何调试Visual Studio 2019未连接到Android x86 AVD
我正在尝试使用Visual Studio Android工具从Visual Studio 2019调试NativeActivity C ++ Android应用程序。
我的系统使用Windows 10 Pro(已启用Hyper-V),并运行许多其他Hyper-V映像(由于某种原因无法关闭),但是Windows开发的安装是“主”(主机)操作系统。
我可以构建示例应用程序,并且可以尝试将其连接到VisualStudio_android-25_arm_phone AVD。但是,发生以下两种情况之一:
- 如果我刚用完Visual Studio,就会收到错误消息:
Severity Code Description Project File Line Suppression State
Error Error installing the package. The device 'VisualStudio_android-25_x86_phone' is invalid or not running. Please switch to another device,or use the Android Virtual Device (AVD) Manager to start a compatible emulator,or connect a compatible Android device. XMCRemote3.Packaging 0
- 如果我在AVD管理器中启动适当的x86 AVD,则设备实际上会启动。然后,如果我尝试在Visual Studio中运行,则会从AVD管理器中收到一个错误对话框,提示该设备和主机具有不同版本的ADB。
Device error: adb server version (39) doesn't match this client (41); killing...
* daemon started successfully
adb.exe: device offline
这是发生这种情况时的Visual Studio日志:
1>Failed to start emulator.
1>emulator: Requested console port 5556: Inferring adb port 5557.
1>emulator: ERROR: x86 emulation currently requires hardware acceleration!
1>Please ensure Intel HAXM is properly installed and usable.
1>CPU acceleration status: Android Emulator requires an Intel processor with VT-x and NX support. Your CPU: 'AuthenticAMD'
1>Error installing the package. The device 'VisualStudio_android-25_x86_phone' is invalid or not running. Please switch to another device,or connect a compatible Android device.
1>The device is invalid or is not running.
我不认为存在x86设备无法在AMD上运行的问题,因为我正在使用Hyper-V,并且该设备可以启动并在手动启动时是交互式的。
有时,我认为我可能遇到“ ADB端口号”问题,因为日志中的错误消息有时涉及端口5556和5557,有时涉及5553和5554。但是,我一点也不知道是来自它或如何处理。
而且,就像上述情况2一样,有时它只是声称ADB不匹配。
对此我该怎么办?我是否需要更新设备映像或本地工具?两者都是最近下载/安装的。
我针对最低版本和目标版本都针对SDK版本21。 SDK Tools版本为30.0.4,仿真器为30.1.5。 已安装的平台是8.0 / 26和7.1 / 25(列表仅上升到8.1 / 27) 有趣的是,即使Visual Studio可以编译和链接它,也没有在SDK和Tools android设置应用中列出“ NDK”版本。
我想知道Visual Studio软件包是否在侧面安装东西?如果是这样,除了Visual Studio“工具”菜单中的“ Android”子菜单外,还有没有其他工具可以管理它?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。