Skip to content

CI: todoapp-avalonia / ios build fails - .NET for iOS 26.5 requires Xcode 26.5, macos-latest only has Xcode 16.4 #529

Description

@adrianhall

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 image macos-15-arm64, version 20260706.0213.1, macOS 15.7.7
  • Installed Xcode on that image: 16.4
  • dotnet workload install ios step succeeds and installs Microsoft.iOS.Sdk.net10.0_26.5 version 26.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 DisplayAlertDisplayAlertAsync 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, job ios:
    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
    No Xcode/workload version is pinned; dotnet workload install ios grabs whatever the latest Microsoft.iOS.Sdk.net10.0_* manifest advertises (currently 26.5, which requires Xcode 26.5), regardless of what Xcode version the macos-latest image actually ships (currently 16.4).

Suggested fixes (any of)

  1. Pin a specific Microsoft.iOS.Sdk / rollback workload version for the ios workload install (e.g. dotnet workload install ios --version <manifest-version> or a rollback.json) so it matches whatever Xcode ships on macos-latest.
  2. Pin the runner to a specific macOS image/Xcode version instead of floating macos-latest (e.g. macos-15 and/or xcode-select to a known-good Xcode, similar to how maccy/xcode-select@... or maxim-lobanov/setup-xcode@v1 could be used), and keep it in sync with the .NET for iOS SDK's requirement.
  3. Investigate why the plain ios workload doesn't negotiate down to a compatible pack the way maui-ios does in the same run, and consider aligning TodoApp.Avalonia.iOS's workload install with whatever mechanism lets maui-ios pick net10.0_26.0 automatically.

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

Metadata

Metadata

Assignees

Labels

ExamplesInfrastructureChanges to the build and release systemRequires TriageThis issue has not been checked by the project team.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions