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

NuGet Restore process fails with the latest macOS11 agent update and MSBuild -t:restore in azure pipelines for Xamarin Forms app build. #16465

Closed
skadookkunnan opened this issue Jun 17, 2022 · 5 comments
Labels
Area: ABTT Akvelon Build Tasks Team area of work Area: Artifacts bug question

Comments

@skadookkunnan
Copy link

skadookkunnan commented Jun 17, 2022

Note

Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo

For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

If you have an issue or request for the Azure Pipelines service, use developer community instead:

https://developercommunity.visualstudio.com/spaces/21/index.html )

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug / Question

Enter Task Name: MSBuild fails with unable to resolve on NuGet restore step.

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

  • Server - Azure Pipelines

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number: N/A
  • Agent - Hosted

    • If using Hosted agent, provide agent queue name: macOS-11

Issue Description

We had an Azure DevOps pipeline setup for the Xamarin Forms app build and working fine until yesterday.
From today morning, the MSBuild step (which does the nuget restore) keeps failing with the following error as per the logs/image attached below.

Tried different approaches based on the Microsoft documentation and forum answers, but does not seem to work yet.

Pipeline_Failure

The error happens only in Azure Pipelines in Azure DevOps.

If I run the same command in the local --> msbuild -t:restore **/*.sln in the local CLI, it works without any issues.

Could anyone please help to pin out the issue here?

[Include task name(s), screenshots and any other relevant details]

Task logs

/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Autofac (>= 5.2.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'AutoMapper (>= 8.1.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'CarouselView.FormsPlugin (>= 6.0.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Com.Airbnb.Xamarin.Forms.Lottie (>= 3.0.4)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'FluentValidation (>= 8.6.2)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AppCenter (>= 4.5.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AppCenter.Analytics (>= 4.5.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AppCenter.Crashes (>= 4.5.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Newtonsoft.Json (>= 13.0.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Rg.Plugins.Popup (>= 2.1.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'SkiaSharp.Views.Forms (>= 2.80.3)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Essentials (>= 1.7.2)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Forms (>= 5.0.0.2401)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xam.Plugin.Media (>= 5.0.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.CognitiveServices.Speech (>= 1.21.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xam.Plugin.SimpleAudioPlayer (>= 1.6.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Plugin.Permissions (>= 6.0.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Forms.Svg (>= 1.0.3)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Forms.Visual.Material (>= 5.0.0.2401)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Firebase.Core (>= 60.1142.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]

Troubleshooting

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

Error logs

Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Autofac (>= 5.2.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'AutoMapper (>= 8.1.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'CarouselView.FormsPlugin (>= 6.0.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Com.Airbnb.Xamarin.Forms.Lottie (>= 3.0.4)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'FluentValidation (>= 8.6.2)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AppCenter (>= 4.5.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AppCenter.Analytics (>= 4.5.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AppCenter.Crashes (>= 4.5.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Newtonsoft.Json (>= 13.0.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Rg.Plugins.Popup (>= 2.1.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'SkiaSharp.Views.Forms (>= 2.80.3)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Essentials (>= 1.7.2)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Forms (>= 5.0.0.2401)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xam.Plugin.Media (>= 5.0.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Microsoft.CognitiveServices.Speech (>= 1.21.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xam.Plugin.SimpleAudioPlayer (>= 1.6.0)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Plugin.Permissions (>= 6.0.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Forms.Svg (>= 1.0.3)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Forms.Visual.Material (>= 5.0.0.2401)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to resolve 'Xamarin.Firebase.Core (>= 60.1142.1)' for '.NETStandard,Version=v2.1'. [/Users/runner/work/1/s/Solo.sln]

[Insert error from the logs here for a quick overview]

@github-actions github-actions bot added Area: ABTT Akvelon Build Tasks Team area of work Area: Artifacts bug question labels Jun 17, 2022
@msieker
Copy link

msieker commented Jun 17, 2022

I ran into this on a project I'm on, and while I don't know exactly what's causing it, I do know a solution (which might help support figure out what's going on). It's acting like it doesn't have any nuget sources, so placing a nuget.config file in the same directory as your solution, with this as the contents:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

will let it restore packages again.

@skadookkunnan
Copy link
Author

@msieker Thank you so much for the answer! It works fine after adding the nuget.config as you suggested.

@dave-sampson13
Copy link

@msieker Thanks also. This workaround allows us to build again until MS can fix their agent. Hopefully they can add a test for this to their suite prior to releasing new agent images in the future, we shouldn't be discovering this when our builds stop working.

@IliyanPopov
Copy link

@msieker
Thank you buddy. Your solution works with MSBuild task as well.
For some reason, out of nowhere a few days ago our build pipelines started to fail.
Adding the nuget.config file on solution level fixed the issue.

Cheers

@SvetlanaMaliugina
Copy link
Contributor

Hi @skadookkunnan!
It looks like the issue is related to the recent update of the MS Hosted VM image. Here is the opened bug report.
I'm closing this for now since it's not related to the task itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work Area: Artifacts bug question
Projects
None yet
Development

No branches or pull requests

5 participants