Skip to content

ACTool task fails to build when the currently selected Xcode is a symlink #21762

Closed

Description

@AArnott

Apple platform

iOS

Framework version

net8.0-, net9.0-

Affected platform version

.NET 9.0.100

Description

actool cannot be found, but only when in the context of dotnet build:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.1/18.1.9163/tools/msbuild/iOS/Xamarin.Shared.targets(907,3): /usr/bin/xcrun exited with code 72:
xcrun: error: sh -c '/Applications/Xcode_16.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find actool 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "actool", not a developer tool or in PATH [/Volumes/Expansion/git/nerdbank.cryptocurrencies/src/Nerdbank.Zcash.App/Nerdbank.Zcash.App.iOS/Nerdbank.Zcash.App.iOS.csproj]

If I take exactly the command line from the error message and execute it directly, in the same terminal where I spawned dotnet build, it works:

sh -c '/Applications/Xcode_16.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find actool 2> /dev/null'

I get the path to the actool printed in stdout.

I suspect then that the problem is environment variables set by the ACTool msbuild task, but I can't tell because that information isn't captured by the binlog.

Steps to Reproduce

With the .NET 9.0.101 SDK installed on a mac:

dotnet new maui

Modify the csproj to target .NET 9. (why does the .NET 9 SDK create a .NET 6 targeted maui project anyway??)
Use xcode-select to verify that Xcode 16.1 is selected.

dotnet build -f net9.0-ios

Problem repros.

Did you find any workaround?

No.

Build logs

binlog: msbuild.zip

Activity

  1. AArnott commented on Dec 6, 2024

    @AArnott
    Author

    This happens exactly when I switch to Xcode 16.1 (which .NET 9 targeting requires). If I switch back to Xcode 16.0, it works just fine.

  2. rolfbjarne commented on Dec 6, 2024

    @rolfbjarne
    Member

    This looks like a variation of #3931.

    Can you try executing this script, to see if that shows the same error?

    https://gist.github.com/rolfbjarne/0cfcd18e187102ad48402aefe2d0f2c4

    why does the .NET 9 SDK create a .NET 6 targeted maui project anyway??

    That sounds like a different bug (I don't see this behavior). I would suggest filing this in the MAUI repo.

  3. added
    need-info
    on Dec 6, 2024
  4. added this to the Future milestone on Dec 6, 2024
  5. AArnott commented on Dec 11, 2024

    @AArnott
    Author

    @rolfbjarne That script appears to have worked when targeting Xcode 16.1, both with and without the leading export statements.

  6. added
    need-attention
    and removed
    need-info
    on Dec 11, 2024
  7. rolfbjarne commented on Dec 12, 2024

    @rolfbjarne
    Member

    @AArnott and building your project with dotnet build ... from the command line still fails?

  8. added
    need-info
    no-auto-reply
    and removed
    need-attention
    on Dec 12, 2024
  9. AArnott commented on Dec 13, 2024

    @AArnott
    Author
  10. added
    need-attention
    and removed
    need-info
    on Dec 13, 2024
  11. 26 remaining items

  12. jamescrosswell commented on Oct 20, 2025

    @jamescrosswell

    Just ran into this with Xcode 26. In our github actions we had:

        # See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode
        - name: Pin the Xcode Version
          if: runner.os == 'macOS'
          shell: bash
          run: sudo xcode-select --switch /Applications/Xcode_26.app

    In theory, that should work since there's a symlink from /Applications/Xcode_26.0.app to /Applications/Xcode_26.0.1.app in the macos-15 runner.

    In practice, dotnet fails to find things like actool so the above had to be changed so that xcode-select references the specific path rather than the symlink:

        # See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode
        - name: Pin the Xcode Version
          if: runner.os == 'macOS'
          shell: bash
          run: sudo xcode-select --switch /Applications/Xcode_26.0.1.app

    I guess that's OK once you know... took me a few hours to discover this though and the solution/workaround is a bit more fragile as, if GitHub bump the version of Xcode that is installed to 26.0.2 or 26.1.0 in the future, all our builds will start breaking. The symlink could survive minor version bumps.

  13. changed the title [-]ACTool task fails build when xcrun actool cannot find tool[/-] [+]ACTool task fails to build when the currently selected Xcode is a symlink[/+] on Oct 21, 2025
  14. Mertsch commented on Nov 16, 2025

    @Mertsch

    MAUI .NET 10: It seems to be happening again...

    https://github.com/actions/runner-images/blob/51665f334774c42174771890df8acafcf55010b6/images/macos/macos-15-Readme.md?plain=1#L166

    | Version        | Build    | Path                                           | Symlinks                                                       |
    | -------------- | -------- | ---------------------------------------------- | -------------------------------------------------------------- |
    | 26.1           | 17B54    | /Applications/Xcode_26.1_Release_Candidate.app | /Applications/Xcode_26.1.0.app<br>/Applications/Xcode_26.1.app |
    

    with 26.1

    xcodebuild: error: SDK "/Applications/Xcode_26.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" cannot be located.
    xcrun: error: sh -c '/Applications/Xcode_26.1.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_26.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find actool 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
    xcrun: error: unable to find utility "actool", not a developer tool or in PATH
    

    with 26.1_Release_Candidate it works.

  15. jamescrosswell commented on Nov 16, 2025

    @jamescrosswell
  16. Mertsch commented on Nov 17, 2025

    @Mertsch

    @Mertsch did you try this?

    Yes, that's what I am saying, symlink /Applications/Xcode_26.1.app does not work,
    /Applications/Xcode_26.1_Release_Candidate.app does.

  17. reinierkops commented on Nov 20, 2025

    @reinierkops

    When we're using the /Applications/Xcode_26.1_Release_Candidate.app path, we're getting this error in the pipeline when building a .net10-ios application

    <dict> <key>com.apple.actool.compilation-results</key> <dict> <key>output-files</key> <array> <string>/Users/runner/work/1/s/Source/obj/Develop/net10.0-ios/ios-arm64/actool/bundle/appicon60x60@2x.png</string> <string>/Users/runner/work/1/s/Source/obj/Develop/net10.0-ios/ios-arm64/actool/bundle/appicon76x76@2x~ipad.png</string> <string>/Users/runner/work/1/s/Source/obj/Develop/net10.0-ios/ios-arm64/actool/partial-info.plist</string> </array> </dict> <key>com.apple.actool.errors</key> <array> <dict> <key>description</key> <string>No simulator runtime version from ["22E238", "22F77", "22G86", "23A8464"] available to use with iphonesimulator SDK version 23B77</string> </dict> </array> </dict>

    We're builing it for ios-arm64, without the use of the simulator...

  18. rolfbjarne commented on Nov 21, 2025

    @rolfbjarne
    Member

    We're builing it for ios-arm64, without the use of the simulator...

    Yes, for some reason Apple's toolchain requires simulator bits, even when building for device (in this case it's the actool, which is used to compile asset catalogs, but it's not the only tool that always requires the simulator).

    And it may work to do this first:

    $ xcodebuild -downloadPlatform iOS

  19. SteveBush commented on Nov 22, 2025

    @SteveBush

    Is there a working example of building an MAUI iOS application in Azure Pipelines that targets .NET 10? I have not found an XCode SDK version that works, including the RC. GitHub actions work fine when use image macOS 26 and XCode 26.1.0.

  20. zippo227 commented on Nov 23, 2025

    @zippo227
    Contributor

    Is there a working example of building an MAUI iOS application in Azure Pipelines that targets .NET 10? I have not found an XCode SDK version that works, including the RC. GitHub actions work fine when use image macOS 26 and XCode 26.1.0.

    I added some details here.

    #24314 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementmsbuild

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions