-1

我正在尝试在 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?
4

1 回答 1

0

如果项目中有 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>

谢谢你。

于 2021-05-31T03:10:58.830 回答