0
votes

Facing below error while building the Xamarin.iOS project. It builds on my local machine. And not on Hosted macOS High Sierra Hosted Agent.

Xamarin.iOS task failed with error Error: /Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild failed with return code: 1. For guidance on setting up the build pipeline, see https://go.microsoft.com/fwlink/?LinkId=760847. Please check the screenshot attached to understand the settings.

Here is more information regarding settings.

YAML file for Xamarin.IOS

Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 #Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 steps: -

task: XamariniOS@2

displayName: 'Build Xamarin.iOS solution **/*.sln'

inputs:

solutionFile: '$(Parameters.solution)'

configuration: '$(BuildConfiguration)'

clean: true

packageApp: false

buildForSimulator: true

runNugetRestore: true

YAML file for Nuget Restore

Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

steps: -

task: NuGetCommand@2

displayName: 'NuGet restore'

inputs:

restoreSolution: '$(Parameters.solution)'

YAML file for Nuget 4.5

steps: - task: NuGetToolInstaller@0

displayName: 'Use NuGet 4.5'

inputs: versionSpec: 4.5

checkLatest: true

1
Is your local machine also running High Sierra? And is the iOS SDK version for both also the same?Saamer

1 Answers

0
votes

Do you have more than one solution *.sln file in your repo ? It looks like your CI select the wrong solution file. If you are new to Azure CI, I think the best way is to use classic Editor (Microsoft make the yaml code the new default now). Select Use the classic editor when you first create your pipeline.

enter image description here

Then select Xamarin.iOS template enter image description here

In there change this enter image description here

To select the correct solution file where your Xamarin iOS project located. enter image description here