close
Skip to content

Error MSB4018: The "DetectSdkLocations" task failed unexpectedly. #25462

@Leo506

Description

@Leo506

Apple platform

iOS

Framework version

net10.0-*

Affected platform version

.NET: 10.0.300 iOS: 26.5.10280

Description

After releasing the last version of iOS workloads (with support Xcode 26.5) my app is failed to build on Microsoft Azure Agent with error:
##[error]/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.5/26.5.10280/tools/msbuild/Xamarin.Shared.targets(2091,3): Error MSB4018: The "DetectSdkLocations" task failed unexpectedly.

The same error on my personal Mac

Steps to Reproduce

  1. Update .Net to 10.0.300 and install the last iOS workloads
  2. Try to build any .net10-ios project
  3. Error

Did you find any workaround?

No response

Build logs

System.TypeInitializationException: The type initializer for 'Xamarin.MacDev.AppleSdkSettings' threw an exception.
       ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path')
         at System.ArgumentNullException.Throw(String paramName)
         at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
         at System.ArgumentException.ThrowNullOrEmptyException(String argument, String paramName)
         at System.IO.Directory.CreateDirectory(String path)
         at Xamarin.MacDev.AppleSdkSettings..cctor() in /Users/builder/azdo/_work/1/s/macios/external/Xamarin.MacDev/Xamarin.MacDev/AppleSdkSettings.cs:line 145
         --- End of inner exception stack trace ---
         at Xamarin.MacDev.AppleSdkSettings.Init() in /Users/builder/azdo/_work/1/s/macios/external/Xamarin.MacDev/Xamarin.MacDev/AppleSdkSettings.cs:line 156
         at Xamarin.MacDev.Tasks.DetectSdkLocations.ExecuteImpl() in /Users/builder/azdo/_work/1/s/macios/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs:line 148
         at Xamarin.MacDev.Tasks.DetectSdkLocations.Execute() in /Users/builder/azdo/_work/1/s/macios/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs:line 130
         at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
         at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket buc
      ket, TaskExecutionMode howToExecuteTask)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIf an issue is a bug or a pull request a bug fixregressionThe issue or pull request is a regression

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions