xamarin android 项目的 App Center 构建失败

App Center build failed for xamarin android project

我正尝试在 APP CENTER 上为 xamarin Android 项目设置构建配置,如下所示。

当我 运行 构建时出现以下错误。

"/Users/runner/work/1/s/EmguCVSource/Android/Emgu.CV.Platform.Android.csproj" (default target) (2:2) ->
(_CheckForInvalidConfigurationAndPlatform target) -> 
  /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(791,5): error : The OutputPath property is not set for project 'Emgu.CV.Platform.Android.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Dev'  Platform='AnyCPU'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [/Users/runner/work/1/s/EmguCVSource/Android/Emgu.CV.Platform.Android.csproj]

    141 Warning(s)
    1 Error(s)

Time Elapsed 00:00:38.88
##[error]Error: The process '/Library/Frameworks/Mono.framework/Versions/6_4_0/bin/msbuild' failed with exit code 1
See https://go.microsoft.com/fwlink/?LinkId=760847.```

i tried to fix this by changing mono version but not success.

what should i do to avoid this issue?

如果项目中有 2 个 csproj,这是一个很好的示例。

就我而言,我有 2 个。

  1. 原创xamarin.android.csproj.
  2. Emgu.CV.Platform.Android.csproj(我用于图像转换)

要解决此问题,我必须保持更新 Emgu.CV.Platform.Android.csproj 与 xamarin.android.csproj 相同。

所以我通过添加下面的代码行解决了这个问题。

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Dev|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>$(OpenCVBinaryDir)\Build$(AssemblyName)$(Platform)$(Configuration)\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
  </PropertyGroup>

谢谢。