azure azure-devops xamarin xamarin.ios

Azure DevOps build of Xamarin.iOS project fails - MTOUCH:错误MT2002:无法解析“ System.Drawing.Color”引用

发布于 2020-04-08 11:27:56

我无法解决Azure DevOps中的Xamarin.iOS应用程序的生成问题。我想知道是否有人有任何建议。

构建iOS版本的应用程序可在VS for Mac中本地运行,但由于以下错误而无法在Azure中运行:

MTOUCH : error MT2002: Failed to resolve "System.Drawing.Color" reference from "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [/Users/runner/runners/2.164.6/work/1/s/iOS/CatRentalStore.iOS.csproj]

我在Android版本中遇到类似的问题。我通过从托管macOS-10.14的构建代理程序切换到Windows-2019代理程序解决了此问题,但这不是iOS应用程序的选项。

我已经将可能使用System.Drawing.Color的软件包更新为最新的稳定版本-Acr.UserDialogs,BTProgressHUD,Splat和Xamarin.Essentials。

我搜索了解决方案的源,但没有找到对System.Drawing.Color类的任何直接引用。

我还尝试使用来指定要在构建中使用的Xamarin / Mono版本,以匹配我的本地版本sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_4_0这导致发生另一个错误:

error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
error MSB4018: System.MissingMethodException: Method not found: System.Collections.Generic.IList`1<NuGet.Packaging.Core.PackageDependency> NuGet.ProjectModel.LockFileTargetLibrary.get_Dependencies()

对此问题的引用:

https://github.com/mono/mono/issues/13483

https://github.com/xamarin/xamarin-macios/pull/6011

https://github.com/aritchie/userdialogs/issues/654

https://github.com/reactiveui/splat/issues/204

查看更多

提问者
Tommy Baggett
被浏览
121
ReadyToLearn 2020-02-06 15:30

根据此文件

NET Core 2.2.105在VM映像上是默认设置,但是Mono版本6.0或更高版本需要.NET Core 2.2.300+如果使用Mono 6.0或更高版本,则必须使用.NET Core Tool Installer任务覆盖.NET Core版本如果使用6.4.0,则需要至少安装2.2.300+ .net core。