Repository navigation
Description
Description
replacing issue# 35446 in the hopes of getting more attention on this issue
Similar to issue# 20918, or maybe issue# 17340, BUT 20918 doesn't seem to have a final resolution, and the ILLink package ref'd in 17340 solution is not included in our project.
We published our maui app to Google Play and Apple App stores back in December, now we're looking to do an update.
When building for iOS, we built our new code using the same environment used for December build just fine, but when we tried to upload to TestFlight, we ran into the updated requirement where we must now build with iOS 26 SDK (we were using iOS 18.5 SDK); we upgraded to XCode 26 and have iOS 26.2 platform available.
Now, when we try to build for iOS we get the following error:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_26.2/26.2.9008/targets/Xamarin.Shared.Sdk.targets(1387,3): error MSB4018:
The "AOTCompile" task failed unexpectedly.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (One or more errors occurre
d. (An error occurred trying to start process '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.os
x-arm64.Cross.ios-arm64/9.0.9/Sdk/../tools/mono-aot-cross' with working directory '/Users/xinjundong/Documents/is
can-mobile/Apps/IScanBT'. No such file or directory)))
...indeed, the ref'd 9.0.9 version is not installed, we have 9.0.15 instead.
Need some guidance on (presumably) changing some config file or parameter to point to the correct version, or some other workaround for this issue.
What we tried:
- cleared NuGet cache- still fails
- set PublishAOT = false in csproj- still fails
- search for 9.0.9 refs in project and platform build artifacts- not found
- copied 9.0.15 version to 9.0.9 path ref'd in error message; the build completes but we're getting weird layout issues that we don't see in the equivalent Android build from the same source (this is obviously extremely hacky- I didn't expect the build to work and not surprised the runtime has issues)
re regression question below- it arguably is or is not a regression, depending on your perspective (thus the conflicting answer x2), but I assume it's really just a config issue
Steps to Reproduce
- Have an existing working app and working iOS build process utilizing XCode + iOS 18.5 SDK
- Upgrade to XCode 26 + iOS 26.2 SDK
- Attempt to build with dotnet cli
- The build fails with error ref'ing /dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.os
x-arm64.Cross.ios-arm64/9.0.9/ path, we have */9.0.15/ instead
Link to public reproduction project repository
No response
Version with bug
9.0.100 SR10
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI, No, this is something new
Last version that worked well
9.0.100 SR10
Affected platforms
iOS
Affected platform versions
iOS 26.2 SDK (build error after upgrading XCode + iOS from 18.5 SDK, which worked fine); dotnet workload list refs Manifest Version=9.0.120/9.0.100 & Installation Source=SDK 9.0.300 for both Android & iOS
Did you find any workaround?
No
Relevant log output
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_26.2/26.2.9008/targets/Xamarin.Shared.Sdk.targets(1387,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-arm64.Cross.ios-arm64/9.0.9/Sdk/../tools/mono-aot-cross' with working directory '/Users/xinjundong/Documents/iscan-mobile/Apps/IScanBT'. No such file or directory)))
## ...indeed, the ref'd 9.0.9 version is not installed, we have 9.0.15 instead. ##
Activity
PureWeen commentedon May 19, 2026
@dalexsoto @rolfbjarne
rolfbjarne commentedon May 20, 2026
Could you get the following information?
dotnet --infoThanks!
jifryk commentedon May 20, 2026
I should've mentioned- we did a
dotnet workload updateyesterday; retrying the build after, we got the following:...so installed Xcode 26.5, retrying the build again after that failed with the same original error
jifryk commentedon May 20, 2026
As requested:
dotnet_maui_issue#25481_dotnet_list_output.txt
dotnet_maui_issue#25481_msbuild_binlog.zip
rolfbjarne commentedon May 20, 2026
Can you try deleting this file (relative to the project directory) and see if that fixes anything?
jifryk commentedon May 20, 2026
it appears that addressed our issue- I'm being told the build now completes successfully, will have absolute confirmation tomorrow
rolfbjarne commentedon May 22, 2026
OK; I'll keep this open since it seems we have a caching/incremental builds issue we need to fix here.
[-]Getting "The AOTCompile task failed unexpectedly." when trying to build for iOS after upgrade to iOS 26.2 SDK, it's referencing a different version of AOT ios arm64 pack than what's installed[/-][+][msbuild] Cached AOT compiler path not always invalidated after .NET upgrade[/+]jifryk commentedon May 22, 2026
Sorry I didn't get back to this yesterday- I can absolutely confirm we're now able to build and distribute thru TestFlight.
We discovered another cosmetic issue that wasn't occurring under the older iOS SDK and doesn't happen on Android. I am pretty sure this is something we're doing wrong in the xaml, but interesting that the rendering changed. I am planning to log another ticket next week on that once I get arms around it mostly as an FYI in case someone else bumps into it.
We're all set on this topic, I'll leave this ticket for you to manage going forward with the refined title.
rolfbjarne commentedon Oct 20, 2026
Closing, this will be fixed in .NET 11 (because we're not using the Mono AOT compiler anymore).
docs(ios): Document the stale AOT compiler path
docs(ios): Document the stale AOT compiler path