How to fix The AOTCompile task failed unexpectedly in .NET Maui iOS on MacOs?

Jerod Motley 0 Reputation points
2025-05-09T18:30:43.9466667+00:00

I recently moved from an x86 Intel Macbook to an Apple Silicon Macbook. I'm working on a .NET9 iOS app in Maui using JetBrains Rider. The app builds but won't deploy. The error states that the AOTCompile command is looking in the wrong directory for .NET9. It's looking in the folder for where the x86 version would be.

dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.4

when the folder should be

dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/9.0.4

My question is, how do I fix this? I installed .net9 for arm as I should have but this Xamarin tool is looking in the wrong folder. Any thoughts?

Error is below: Xamarin.Shared.Sdk.targets(1266,3): Error MSB4018 : The "AOTCompile" task failed unexpectedly.

System.AggregateException: One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (An error occurred trying to start process '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.4/Sdk/../tools/mono-aot-cross' with working directory '/Users/me/Documents/folder/project'. No such file or directory)))

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,104 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 75,386 Reputation points Moderator
    2025-05-10T18:00:47.14+00:00

    this sounds like a jetbrains issue of using the wrong tool chain. You should check with them on migration of a project to arm.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.