问题描述
我正在尝试使用Visual Studio Android工具从Visual Studio 2019调试NativeActivity C ++ Android应用程序。
我的系统使用Windows 10 Pro(已启用Hyper-V),并运行许多其他Hyper-V映像(由于某种原因无法关闭),但是Windows开发的安装是“主”(主机)操作系统。
我可以构建示例应用程序,并且可以尝试将其连接到VisualStudio_android-25_arm_phone AVD。但是,发生以下两种情况之一:
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
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 (将#修改为@)