C# Xamarin Android构建失败”;outputAssembly“的值无效;

C# Xamarin Android构建失败”;outputAssembly“的值无效;,c#,android,xamarin,xamarin.forms,xamarin.android,C#,Android,Xamarin,Xamarin.forms,Xamarin.android,几天前,我的解决方案似乎运行良好,但今天,Android项目突然无法构建。 我没有得到任何错误,但我确实得到以下输出: 1>Build started. 1>Project "MyApp.Android.csproj" (Install target(s)): 1>Project "MyApp.csproj" (GetTargetFrameworks target(s)): 1>Done building project "MyApp.csproj". 1>Proj

几天前,我的解决方案似乎运行良好,但今天,Android项目突然无法构建。 我没有得到任何错误,但我确实得到以下输出:

1>Build started.
1>Project "MyApp.Android.csproj" (Install target(s)):
1>Project "MyApp.csproj" (GetTargetFrameworks target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetTargetFrameworks target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetTargetPath target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetTargetPath target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetNativeManifest target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetNativeManifest target(s)):
1>Done building project "MyApp.csproj".
1>"obj\Debug\MyApp.Android.dll;obj\Debug\MyApp.Android.dll" is an invalid value for the "OutputAssembly" parameter of the "Csc" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".
1>Done building project "MyApp.Android.csproj" -- FAILED.
1>Build FAILED.
我还尝试删除bin en obj文件夹,清理并重建解决方案,删除MyApp.Android.dll。 但在重建之后,同样的事情再次发生

我确实收到了以下警告:

Severity    Code    Description Project File    Line    Suppression State
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.   BarApp.Android      1   Active

您必须将项目
仅链接到Sdk程序集
,并将支持架构设置为
armeabi-v7
x86

尝试
清理
重建
项目后


它工作起来很有魅力。

如果您使用可移植类库(PCL)方法在Android和iOS之间组织代码,您可以通过右键单击Android项目并在Visual Studio中选择菜单选项“卸载项目”卸载该项目。然后重新编译PCL项目,再次重新加载Android项目(右键单击->“重新加载项目”)并重建解决方案。这一次应该没有错误。现在尝试在Android emulator上再次运行该应用程序


您可能还必须重新启动仿真器并从仿真器/设备卸载应用程序,然后才能再次成功运行它。

我必须清理项目,删除bin文件夹(只是为了确保),然后生成失败,真正的原因是:引用不正确

有人复制了项目dll,而没有链接到项目


更正了引用,一切正常。

在文件资源管理器中打开项目,从解决方案中删除bin和obj文件,转到解决方案

  • 在droid项目中单击鼠标右键“转到”选项

  • 选择Android选项将项目链接设置为仅SDK程序集,然后单击高级将支持架构设置为armeabi-v7和x86

  • 最后清理和重建项目


  • 在项目集中,仅链接到
    Sdk程序集
    ,并检查
    armeabi-v7
    x86
    的支持体系结构。谢谢!我已经在你的答案中列出了所有内容,但是我也检查了“Armeabi”(没有-v7),所以我检查了它,现在它工作了(:如果您将其作为答案发布,我将接受。我们在哪里设置支持体系结构?您能解释为什么吗?在将我的
    可移植类库
    迁移到
    .net standard
    并将.net standard包更新为2.0.2之后,我遇到了这个问题。这些体系结构是什么?我在升级到之后也开始得到这个问题。来自PCL的Net标准2.0。我们已经关闭了项目内的链接(过去有问题)。当我开始遇到这个问题时,我必须重新启动visual studio,然后我通常可以在几个小时内不再遇到它。经常重新启动真的很烦人。@pettysI也遇到过同样的问题,一些清理和重建帮助:/@Ayudh单击“属性/Android选项”选项卡上的“高级”按钮。