简体   繁体   English

[INSTALL_FAILED_INVALID_APK]Xamarin.Forms 缺少 Base.apk

[英][INSTALL_FAILED_INVALID_APK]Base.apk is missing with Xamarin.Forms

Not sure if this is the correct place for this but I have no idea what is happening.不确定这是否是正确的地方,但我不知道发生了什么。

I have installed Visual Studio, selected the Xamarin.Form development option.我已经安装了 Visual Studio,选择了Xamarin.Form开发选项。 I then created a blank app called AwesomeApp.然后我创建了一个名为 AwesomeApp 的空白应用程序。 When I create ANY android simulator, I get the below error:当我创建任何 android 模拟器时,我收到以下错误:

ADB0010: Deployment failed Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.companyname.awesomeapp-n7s-TVkN9lE8v1nea3tFZg==: Package /data/app/com.companyname.awesomeapp-n7s-TVkN9lE8v1nea3tFZg==/base.apk code is missing] ADB0010:部署失败 Mono.AndroidTools.InstallFailedException:失败 [INSTALL_FAILED_INVALID_APK:包无法安装在 /data/app/com.companyname.awesomeapp-n7s-TVkN9lE8v1nea3tFZg==:包 /data/app/com.companyname.awesomeapp n7s-TVkN9lE8v1nea3tFZg==/base.apk 代码丢失]

Has anyone experience this or even found a way around this?有没有人经历过这个甚至找到了解决这个问题的方法? Following the suggestions only, such as cleaning the project, solution and rebuilding are not working.仅遵循建议,例如清理项目,解决方案和重建不起作用。 This happens with any project, no matter of the name or naming convention (ie AwesomeApp or awesomeapp)任何项目都会发生这种情况,无论名称或命名约定如何(即 AwesomeApp 或 awesomeapp)

For me it's fixed by changing Dex Compiler from dx to d8 and disabling Shared Mono Runtime & Multi Dex对我来说,它是通过将 Dex Compiler 从 dx 更改为 d8 并禁用 Shared Mono Runtime & Multi Dex 来解决的

Upd: A bit late but disabling Shared Mono Runtime is optional.更新:有点晚了,但禁用共享单声道运行时是可选的。 Found out that it also works with it.发现它也适用于它。

Try setting your project back to the current recommended defaults.尝试将您的项目设置回当前推荐的默认值。 Remove all of the following properties from the .csproj file:从 .csproj 文件中删除以下所有属性:

  • AndroidEnableMultiDex AndroidEnableMultiDex
  • AndroidDexGenerator安卓Dex生成器
  • AndroidLinkTool安卓链接工具
  • AndroidDexTool安卓Dex工具

This will let Xamarin.Android pick the current latest default values.这将使 Xamarin.Android 选择当前最新的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM