Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin.iOS builds failing with Xcode 13.4.1 #6362

Closed
2 of 11 tasks
jcmanke opened this issue Oct 6, 2022 · 13 comments
Closed
2 of 11 tasks

Xamarin.iOS builds failing with Xcode 13.4.1 #6362

jcmanke opened this issue Oct 6, 2022 · 13 comments

Comments

@jcmanke
Copy link

jcmanke commented Oct 6, 2022

Description

Xamarin.iOS builds using Xcode 13.4.1 have been failing since the default Xcode version was updated to 14.0.1.

Xcode version is being set to 13.4.1 using xcode-select tool but the build logs show 14.0.1 is still being used, for example:

53:03.2743340Z _CoreOptimizePngImages:
2022-10-05T16:53:03.2744990Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 Resources/if_arrow_sans_down_103299.png obj/iPhone/VT/optimized/if_arrow_sans_down_103299.png 
2022-10-05T16:53:03.6841120Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 Resources/hmb.png obj/iPhone/VT/optimized/hmb.png 
2022-10-05T16:53:04.0930740Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 "Resources/hmb@2x.png" "obj/iPhone/VT/optimized/hmb@2x.png" 
2022-10-05T16:53:04.3386240Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 "Resources/hmb@3x.png" "obj/iPhone/VT/optimized/hmb@3x.png" 
2022-10-05T16:53:04.6047180Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 "Resources/Profile@2x.png" "obj/iPhone/VT/optimized/Profile@2x.png" 
2022-10-05T16:53:04.8320410Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 "Resources/Profile@3x.png" "obj/iPhone/VT/optimized/Profile@3x.png" 
2022-10-05T16:53:05.2525790Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 Resources/Profile.png obj/iPhone/VT/optimized/Profile.png 
2022-10-05T16:53:05.6371970Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 Resources/Images/about_screen_list_image.png obj/iPhone/VT/optimized/Images/about_screen_list_image.png 
2022-10-05T16:53:05.9819350Z   /Applications/Xcode_14.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -iphone -f 0 Resources/icon_green_check.png obj/iPhone/VT/optimized/icon_green_check.png 

The build fails with an error message about the dsymutil utility not being found under 13.4.1.

sh: line 1: 20624 Abort trap: 6           /Applications/Xcode_13.4.1.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_13.4.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find dsymutil 2> /dev/null
  xcrun: error: sh -c '/Applications/Xcode_13.4.1.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_13.4.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find dsymutil 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)
  xcrun: error: unable to find utility "dsymutil", not a developer tool or in PATH

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Runner Image
Image: macos-12
Version: 20220929.2

Is it regression?

macos-12 version 20220917.1

Expected behavior

Xamarin.iOS build uses Xcode 13.4.1 and succeeds.

Actual behavior

Build is using Xcode 14.0.1 tooling and fails upon trying to find a 13.4.1 tool.

Repro steps

  1. Run script sudo xcode-select -s "/Applications/Xcode_13.4.1.app"
  2. Run a build with task XamariniOS@2
@al-cheb
Copy link
Contributor

al-cheb commented Oct 6, 2022

Hey @jcmanke.
Could you try using this action to pick up Xcode version - https://github.com/marketplace/actions/setup-xcode-version ?

- uses: maxim-lobanov/setup-xcode@v1
  with:
        xcode-version: '13.4.1'

@jcmanke
Copy link
Author

jcmanke commented Oct 6, 2022

I am using an Azure DevOps build pipeline, not GitHub.

@al-cheb
Copy link
Contributor

al-cheb commented Oct 6, 2022

I am using an Azure DevOps build pipeline, not GitHub.

In AZDO you should use this command:
sudo xcode-select -s "/Applications/Xcode_13.4.1.app/Contents/Developer"

@jcmanke
Copy link
Author

jcmanke commented Oct 6, 2022

I am doing that, and the build is failing. Did you read before you started replying?

@al-cheb
Copy link
Contributor

al-cheb commented Oct 6, 2022

I am doing that, and the build is failing. Did you read before you started replying?

I see you provided a different command:
Run script sudo xcode-select -s "/Applications/Xcode_13.4.1.app"

@jcmanke
Copy link
Author

jcmanke commented Oct 6, 2022

I'm sorry, I copy pasted that from #6225 when I was creating the issue. My actual YAML pipeline step is including /Contents/Developer when calling xcode-select.

@actions actions deleted a comment from Thanuwattoy05 Oct 6, 2022
@al-cheb
Copy link
Contributor

al-cheb commented Oct 6, 2022

Could you try to select xamarin ios bundle - Set the Xamarin SDK version on macOS ?

- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_12_19
  displayName: 'Select Xamarin SDK version'

@jcmanke
Copy link
Author

jcmanke commented Oct 6, 2022

Still the same error with that script.

@al-cheb
Copy link
Contributor

al-cheb commented Oct 6, 2022

Still the same error with that script.

Could you share a test repo?

@al-cheb al-cheb assigned al-cheb and unassigned al-cheb Oct 7, 2022
@al-cheb
Copy link
Contributor

al-cheb commented Oct 12, 2022

@jcmanke, Any updates?

@williamchenicon
Copy link

Any updates?

@jcmanke
Copy link
Author

jcmanke commented Oct 14, 2022

Attaching logs for a failed build using Xcode 13.4.1 and Xamarin SDK 6_12_19
logs_167763.zip

@jcmanke
Copy link
Author

jcmanke commented Oct 17, 2022

Adding this to the script fixed the build for me:

echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_13.4.1.app

Full AzDO pipeline step:

# Step template to include script which manually select Xamarin SDK version on the Hosted macOS agent
  steps:
  # To manually select a Xamarin SDK version on the Hosted macOS agent, enable this script with the SDK version you want to target
  # https://go.microsoft.com/fwlink/?linkid=871629
  # parameter values: xcodeVersion = Xcode_13.4.1.app, xamarinSdkVersion = 6_12_19
  - script: |
              #List all details about the mac build machine
              system_profiler SPDeveloperToolsDataType

              #Select  the specific XCode version
              echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/${{ parameters.xcodeVersion }}
              
              sudo xcode-select -s /Applications/${{ parameters.xcodeVersion }}/Contents/Developer
              sudo xcode-select -print-path
              
              sudo rm -f '/Applications/Xcode.app'
              sudo ln -s '/Applications/${{ parameters.xcodeVersion }}' '/Applications/Xcode.app'

              #Select  the specific Xamarin SDK version
              sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh ${{ parameters.xamarinSdkVersion }}
              
              #List the various developer tools available on the Agent
              ls -l /Applications
    displayName: 'Select Xcode and Xamarin SDK versions'
    enabled: true

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

No branches or pull requests

4 participants