c# - Xamarin Android 错误 XA0136 部署错误

标签 c# xamarin compiler-errors xamarin.android visual-studio-2019

我正在尝试将我的 Xamarin.Android 应用程序从 Visual Studio 部署到我的智能手机华为 P10。在编译过程中会出现一个弹出窗口:

enter image description here

关闭弹出窗口后会显示错误:

enter image description here

严重性代码描述项目文件行抑制状态

错误 XA0136:“run-as”命令失败,并显示“run-as:软件包安装已损坏:com.companyname.app1”。 当前安装的软件包已损坏。请手动卸载 从设备上的所有用户打包并重试。如果这不起作用,您可以禁用快速部署。 可以在 Visual Studio 项目属性页中禁用快速部署,或者在文本编辑器中编辑项目文件并将“EmbedAssembliesIntoApk”MSBuild 属性设置为“true”。

使用的工具和设备:

  1. Visual Studio 2019 版本 16.10.1

  2. Xamarin Android

  3. 部署到华为 P10 Android 9.0 API 28

任何关于问题所在的建议。

谢谢

更新:如果禁用快速部署则可以正常工作

最佳答案

根据 Xamarin,您必须为此激活开发人员模式。此外,通过 USB 进行调试必须获得批准。你可以找到确切的说法here在 GitHub 上。如果您不知道如何激活该模式,可以找到说明here .

或者,如果所有这些步骤都不起作用,您可以禁用“快速开发”。要么this在您的项目中或通过 Visual Studio。

enter image description here

众所周知,快速部署在阻止 run-as 的设备上会失败,其中通常包括早于 Android 5.0 的设备。系统应用程序 (android:sharedUserId="android.uid.system") 的快速部署也会失败,因为系统应用程序的 run-as 也被阻止。

如果这些解决方案有效,请告诉我!

关于c# - Xamarin Android 错误 XA0136 部署错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67958449/

相关文章:

c# - 使用 uitableview 加载 UIView

c# - UIImagePickerController 出现 "Attempt to present Xamarin_Forms_Platform_iOS_ModalWrapper whose view is not in the window hierarchy"错误

c# - 如何在 Xamarin.Forms 中将参数从一个页面传递到另一个页面?

python - Theano错误: no matching function for call to ‘batch_gemm<float>

android - 向Android应用程序插入数据库时​​出现问题

java - 设置对象彼此相等(java)

c# - 如何一次向多个表中插入数据

c# - SharpShell 服务器 .dll 未签名

c# - 如何在实现 IEnumerable<Foo> 的 Dictionary 包装器类中实现 IEnumerable?

c# - 未将对象引用设置为对象(从 View 调用 Razor 模型)