Azure-pipelines-tasks: If Select custom Xamarin SDK (Mono 5.16.0), MSBuild is not found in Xamarin.iOS task

Created on 30 Jan 2019  路  3Comments  路  Source: microsoft/azure-pipelines-tasks

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Environment

  • Server - Azure Pipelines or TFS on-premises?

    • If using TFS on-premises, provide the version:

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number:
      Account name: gnguyo
      Team project name: Abacus Version 3
      Build definition name: Abacus Version 3-CI / #20190130.8

  • Agent - Hosted or Private:

    • If using Hosted agent, provide agent queue name: Hosted macOS Preview

    • If using private agent, provide the OS of the machine running the agent and the agent version:

Issue Description

In my project I'm using some features of Xamarin IOS 12.2 (Mono 5.16), but the agent has Default Mono Version: 5.12.0 so if I try to make the build directly it fails.

In order to fix that I've included the script to change the Xamarin SDK as detailed here:

- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_16_0
  displayName: 'Select Xamarin SDK version'

But when adding that the build breaks showing that the Xamarin.iOS task failed because it couldn't find MSBuild or xbuild. It seems to be related to #5885 but if I set it to Stable instead of 5_16_0 the task fails again.

Task logs

logs_13.zip

Error logs

[error]Xamarin.iOS task failed with error MSBuild or xbuild (Mono) were not found on the macOS or Linux agent.. For guidance on setting up the build pipeline, see https://go.microsoft.com/fwlink/?LinkId=760847.

CrossPlatform

Most helpful comment

Added before XamariniOS@2:

- script: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_16_0"
- script: /bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_10.1.app;sudo xcode-select --switch /Applications/Xcode_10.1.app/Contents/Developer"

and it worked perfectly thanks

All 3 comments

Please review the updated guidance on selecting the right Xamarin SDK:
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#xamarin

Let us know if this is still an issue.

Thanks,
Madhuri

@fedemkr Hope the guidance in our docs helped. Let us know if this is still an issue for you.

Added before XamariniOS@2:

- script: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_16_0"
- script: /bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_10.1.app;sudo xcode-select --switch /Applications/Xcode_10.1.app/Contents/Developer"

and it worked perfectly thanks

Was this page helpful?
0 / 5 - 0 ratings