Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[xaprepare] always delete ~/android-toolchain/dotnet (#6098)
I'm seeing failures on CI such as: C:\a\_work\2\s\build-tools\xaprepare\xaprepare\package-download.proj : warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. Inconsistency in workload manifest 'microsoft.net.workload.mono.toolchain': missing dependency 'Microsoft.NET.Workload.Emscripten' C:\Users\cloudtest\android-toolchain\dotnet\sdk\6.0.100-preview.7.21369.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. Inconsistency in workload manifest 'microsoft.net.workload.mono.toolchain': missing dependency 'Microsoft.NET.Workload.Emscripten' C:\Users\cloudtest\android-toolchain\dotnet\sdk\6.0.100-preview.7.21369.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,38): error MSB4236: The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. [C:\a\_work\2\s\build-tools\xaprepare\xaprepare\package-download.proj] Error: dotnet restore C:\a\_work\2\s\build-tools\xaprepare\xaprepare\package-download.proj failed. Step Xamarin.Android.Prepare.Step_InstallDotNetPreview failed System.InvalidOperationException: Step Xamarin.Android.Prepare.Step_InstallDotNetPreview failed at Xamarin.Android.Prepare.Scenario.<Run>d__26.MoveNext() in C:\a\_work\2\s\build-tools\xaprepare\xaprepare\Application\Scenario.cs:line 50 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Android.Prepare.Context.<Execute>d__210.MoveNext() in C:\a\_work\2\s\build-tools\xaprepare\xaprepare\Application\Context.cs:line 827 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Android.Prepare.App.<Run>d__3.MoveNext() in C:\a\_work\2\s\build-tools\xaprepare\xaprepare\Main.cs:line 171 I saw the same thing locally, and noticed this folder was out of date: ~/android-toolchain/dotnet/sdk-manifests/6.0.100/microsoft.net.workload.mono.toolchain If we have an outdated `WorkloadManifest.json` or `WorkloadManifest.targets`, the build can get in a state where this step can't succeed. I manually deleted this folder to solve the problem: ~/android-toolchain/dotnet/ Going forward, let's make the `Prepare` step do this every time. This should simplify our .NET 6 provisioning & upgrade process.
- Loading branch information