Error CompileAppManifest Task Failed Unexpectedly
Hope you’ve had a lovely Easter! I caught the flu the week before, and am still recovering. Flu plus Easter = I was away for over a week. Which means by the time I came back and did a pull there had been quite a few changes in the work code base. After staring at the screen for two hours running various updates I finally got around to attempting a build, but got the following error:
Xamarin.Shared.targets(614,3): Error
MSB4018 : The "CompileAppManifest" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at Xamarin.MacDev.Tasks.CompileAppManifest.SetXcodeValues(PDictionary plist, IAppleSdk currentSDK) in /Users/builder/azdo/_work/1/s/macios/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs:line 534
at Xamarin.MacDev.Tasks.CompileAppManifest.Compile(PDictionary plist) in /Users/builder/azdo/_work/1/s/macios/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs:line 338
at Xamarin.MacDev.Tasks.CompileAppManifest.Execute() in /Users/builder/azdo/_work/1/s/macios/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs:line 166
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)If you come across this, take a closer look at the error.
The null reference exception is in the SetXcodeValues method, which usually means you have a SDK mismatch. For me it was simply a missing workload update since I was updating my environment:
dotnet workload updateIf you get this error, make sure you have the right Xcode version for the MAUI version you are using.
Hope this helps!
Comments
Last modified on 2026-04-07
