Repository navigation
CI: todoapp-avalonia / ios build fails - .NET for iOS 26.5 requires Xcode 26.5, macos-latest only has Xcode 16.4 #529
Description
Summary
Surfaced on PR #528 (run 29064641347, job todoapp-avalonia / ios), which only replaces obsolete DisplayAlert with DisplayAlertAsync in TodoApp.Avalonia - it does not touch anything related to iOS or the workload setup. The todoapp-avalonia / ios job (added in #511 / #519) fails in the Build iOS project step:
/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.5/26.5.10284/targets/Xamarin.Shared.Sdk.targets(2570,3):
error : This version of .NET for iOS (26.5.10284) requires Xcode 26.5. The current version of Xcode is 16.4.
Either install Xcode 26.5, or use a different version of .NET for iOS.
See https://aka.ms/xcode-requirement for more information.
[/Users/runner/work/Datasync/Datasync/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.iOS/TodoApp.Avalonia.iOS.csproj]
Job details:
- Runner:
macos-latest→ resolved to imagemacos-15-arm64, version20260706.0213.1, macOS15.7.7 - Installed Xcode on that image: 16.4
dotnet workload install iosstep succeeds and installsMicrosoft.iOS.Sdk.net10.0_26.5version26.5.10284, which requires Xcode 26.5- Build then fails with the version-mismatch error above
Why this looks like an environment/workload issue, not a code issue
The PR diff for #528 only changes a DisplayAlert → DisplayAlertAsync call in TodoApp.Avalonia - nothing in TodoApp.Avalonia.iOS, workload setup, or CI config. The dotnet build output shows the shared TodoApp.Avalonia project (which contains the PR's change) restores and builds fine; the failure happens purely in the Xamarin.Shared.Sdk.targets Xcode-version check for the net10.0-ios head.
Interesting corroborating data point from the same run: the sibling todoapp-maui / ios job (also runs-on: macos-latest, same Xcode 16.4) succeeded. Its dotnet workload install maui-ios step installs multiple iOS SDK pack versions side-by-side:
Installing pack Microsoft.iOS.Sdk.net10.0_26.5 version 26.5.10284...
Installing pack Microsoft.iOS.Sdk.net9.0_18.0 version 18.0.9617...
Installing pack Microsoft.iOS.Sdk.net9.0_26.5 version 26.5.9002...
Installing pack Microsoft.iOS.Sdk.net10.0_26.0 version 26.0.11017...
...and its build actually resolves to Microsoft.iOS.Sdk.net10.0_26.0 (26.0.11017), which is compatible with the installed Xcode 16.4, rather than the newer 26.5 pack. The ios workload (used by TodoApp.Avalonia.iOS, a plain Microsoft.NET.Sdk project referencing Avalonia.iOS) apparently only registers/selects the newest net10.0_26.5 pack and has no fallback, so it hits the hard Xcode-version check instead of negotiating down to a pack compatible with the runner's installed Xcode.
Affected workflow
.github/workflows/build-samples-todoapp-avalonia.yml, jobios:No Xcode/workload version is pinned;ios: runs-on: macos-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-dotnet@v5 with: dotnet-version: ${{ env.DOTNET_VERSION }} # 10.0.x - name: Install iOS workload run: dotnet workload install ios - name: Restore iOS project run: dotnet restore ${{ env.iOSProjectFile }} - name: Build iOS project run: dotnet build ${{ env.iOSProjectFile }} --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore
dotnet workload install iosgrabs whatever the latestMicrosoft.iOS.Sdk.net10.0_*manifest advertises (currently26.5, which requires Xcode 26.5), regardless of what Xcode version themacos-latestimage actually ships (currently 16.4).
Suggested fixes (any of)
- Pin a specific
Microsoft.iOS.Sdk/ rollback workload version for theiosworkload install (e.g.dotnet workload install ios --version <manifest-version>or arollback.json) so it matches whatever Xcode ships onmacos-latest. - Pin the runner to a specific macOS image/Xcode version instead of floating
macos-latest(e.g.macos-15and/orxcode-selectto a known-good Xcode, similar to howmaccy/xcode-select@...ormaxim-lobanov/setup-xcode@v1could be used), and keep it in sync with the .NET for iOS SDK's requirement. - Investigate why the plain
iosworkload doesn't negotiate down to a compatible pack the waymaui-iosdoes in the same run, and consider aligningTodoApp.Avalonia.iOS's workload install with whatever mechanism letsmaui-iospicknet10.0_26.0automatically.
To reproduce
Run the ios job of .github/workflows/build-samples-todoapp-avalonia.yml (or build-samples-todoapp-maui.yml for a comparison) on macos-latest as of image macos-15-arm64 20260706.0213.1 (Xcode 16.4). The plain ios workload install pulls Microsoft.iOS.Sdk.net10.0_26.5 (26.5.10284) and building net10.0-ios fails with the Xcode-version-mismatch error above.
References
- Failing run: https://github.com/CommunityToolkit/Datasync/actions/runs/29064641347
- Failing job: https://github.com/CommunityToolkit/Datasync/actions/runs/29064641347/job/86314313188
- PR that surfaced it (unrelated change): Replace obsolete DisplayAlert with DisplayAlertAsync #528
- CI added in: Add CI workflow to build mobile /samples heads: Android, iOS, Uno (Phase 3 of #509) #511 / ci: add build-samples workflow for Phase 3 mobile heads (#511) #519
- Microsoft doc referenced in the error: https://aka.ms/xcode-requirement
- Runner image migration notice also seen on this job (informational, likely unrelated): macos-latest will migrate to macOS 26 beginning June 15, 2026 - [macOS] macos-latest label will use macos-26 in June 2026 actions/runner-images#14167
Activity
ci: pin iOS workload via --version instead of repo-root global.json (C…
ci: explicitly select Xcode 26.3 to match the pinned iOS workload (Co…
ci: pin iOS workload set + Xcode version for todoapp-avalonia/maui iO…