Without any code changes the pipeline build for android failing with following errors.
/opt/hostedtoolcache/dotnet/packs/Microsoft.Android.Sdk.Linux/33.0.95/tools/Xamarin.Android.Tooling.targets(70,5): error XA5300: The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk [/home/vsts/work/1/s/App/App.csproj::TargetFramework=net7.0-android]
/opt/hostedtoolcache/dotnet/packs/Microsoft.Android.Sdk.Linux/33.0.95/tools/Xamarin.Android.Tooling.targets(70,5): error XA5300: To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path. [/home/vsts/work/1/s/App/App.csproj::TargetFramework=net7.0-android]
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
- task: DotNetCoreCLI@2
displayName: 'Install MAUI workload'
inputs:
command: 'custom'
custom: 'workload'
arguments: 'install maui-android'
- task: DotNetCoreCLI@2
displayName: 'Build Solution'
inputs:
command: 'publish'
publishWebProjects: false
projects: '**/*.sln'
arguments: '-f:net7.0-android -c:Release /p:BuildAndroidOnly=true'
As presented in this github post: https://github.com/actions/runner-images/issues/8952#issuecomment-1886985216
This installs the SDK manually - this should be a temporary solution until Microsoft fixes the builder image.