Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos-13 image seems to not include required targets for Xamarin.Android builds #8647

Closed
2 of 10 tasks
cleardemon opened this issue Oct 24, 2023 · 7 comments
Closed
2 of 10 tasks

Comments

@cleardemon
Copy link

Description

When attempting to build a Xamarin.Android project using the macos-13 image, the build immediately fails because an import cannot be found. None of the .csproj files load due to this issue.

Running against macos-latest works just fine without any changes.

MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/15.0/bin'.
/Users/runner/work/***/***.csproj(175,11): error MSB4226: The imported project "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Also, tried to find "Xamarin/Android/Xamarin.Android.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "/Library/Frameworks/Mono.framework/External/xbuild/" . These search paths are defined in "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/MSBuild.dll.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
/var/folders/q4/3s60g5510ydbd3qc3p4xflm80000gn/T/NuGetScratch/wyd2oteb.8vj.nugetrestore.targets(382,5): warning MSB4181: The "MSBuild" task returned false but did not log an error. [/var/folders/q4/3s60g5510ydbd3qc3p4xflm80000gn/T/NuGetScratch/590d24zq.7i3.nugetinputs.targets]
/var/folders/q4/3s60g5510ydbd3qc3p4xflm80000gn/T/NuGetScratch/wyd2oteb.8vj.nugetrestore.targets(394,5): warning : Skipping restore for project '/Users/runner/work/***/***.csproj'. The project file may be invalid or missing targets required for restore. [/var/folders/q4/3s60g5510ydbd3qc3p4xflm80000gn/T/NuGetScratch/590d24zq.7i3.nugetinputs.targets]

An error occurred when executing task 'Restore'.
Error: NuGet: Process returned an error (exit code 1).
Error: .NET CLI: Process returned an error (exit code 255).

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Image: macos-13
Version: 20231018.14
Included Software: https://github.com/actions/runner-images/blob/macos-13/20231018.14/images/macos/macos-13-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20231018.14

Is it regression?

Believe so. Works fine with runner image 20230921.4 (macos-latest)

Expected behavior

Build to execute.

Actual behavior

Build fails due to potentially missing files.

Repro steps

I am using Cake to build the project (sorry, it is not public). I can attempt to provide repro instructions in a public project, if required.

However, changing runs-on from macos-latest to macos-13 was the only change to my YAML to have this problem occur.

@mikhailkoliada
Copy link
Contributor

Hello! We have no intention to add Xamarin to OS13 images as it is EOL by May 1st 2024, but you can still install tamarin components from brew in runtime, more is here: #8045

@bwalpoleuk
Copy link

This does seem slightly odd that there is such a reluctance to install tooling that Microsoft are officially supporting i.e. Xamarin and XCode 15.

Its correct that the product is approaching EOL next year, but the same argument could be made for all sorts of tooling (for example .NET MAUI 6) should we therefore expect it to be Microsoft policy to remove tooling from agents several months in advance of support actually ending?

@alfeg
Copy link

alfeg commented Nov 13, 2023

Workaround for those who still suffer.

Since #8601 is merged and updated image is available for runners it's now possible to install required xamarin components

        - pwsh: brew install --cask xamarin-ios 
        - pwsh: brew install --cask xamarin-android

Android cask is optional - it's just as example

@nbevans
Copy link

nbevans commented Nov 27, 2023

I will try that tomorrow, thanks.

@jdinnen
Copy link

jdinnen commented Apr 11, 2024

Workaround for those who still suffer.

Since #8601 is merged and updated image is available for runners it's now possible to install required xamarin components

        - pwsh: brew install --cask xamarin-ios 
        - pwsh: brew install --cask xamarin-android

Android cask is optional - it's just as example

Hey there, can i run those commands on a pre build script or something? I cant build Xamarin ios on the MacOS13 image as it fails on Android somehow during the nuget restore

@tneal92
Copy link

tneal92 commented Jun 25, 2024

Workaround for those who still suffer.
Since #8601 is merged and updated image is available for runners it's now possible to install required xamarin components

        - pwsh: brew install --cask xamarin-ios 
        - pwsh: brew install --cask xamarin-android

Android cask is optional - it's just as example

Hey there, can i run those commands on a pre build script or something? I cant build Xamarin ios on the MacOS13 image as it fails on Android somehow during the nuget restore

I'm having the same issue did you manage to get a workaround for this?

@jdinnen
Copy link

jdinnen commented Jun 25, 2024

Workaround for those who still suffer.
Since #8601 is merged and updated image is available for runners it's now possible to install required xamarin components

        - pwsh: brew install --cask xamarin-ios 
        - pwsh: brew install --cask xamarin-android

Android cask is optional - it's just as example

Hey there, can i run those commands on a pre build script or something? I cant build Xamarin ios on the MacOS13 image as it fails on Android somehow during the nuget restore

I'm having the same issue did you manage to get a workaround for this?

Yes I did it a similar way
To work around was to add an appcenter-post-clone.sh to the iOS directory and add the following to it, since it seems to be missing something to do with Android... It would go in the same directory as the iOS SLN file

#!/bin/bash

brew install --cask xamarin-ios 
brew install --cask xamarin-android

Now it installs xamarin-android... FWIW, you can just have the android install as the build scrip will install xamarin-ios later if it is missing. This works for me at least..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants