runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

Xcode 14.1 keeps failing to build without any information about what failed

Open jacobbullock opened this issue 2 years ago • 3 comments

Description

I tried to update our pipelines to use Xcode 14. The build logs show:

/usr/bin/xcodebuild -version
Xcode 14.1
Build version 14B47b

That is also the same version I have locally and it is building fine locally.

The build fails, but there is no info about what failed:

** BUILD FAILED **

##[error]Error: /usr/bin/xcodebuild failed with return code: 65

with system.debug turned on it's not much more helpful:

...
##[debug]success of first tool:false
##[debug]rc:0
##[debug]success:true
##[debug]task result: Failed
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
##[debug]Processed: ##vso[task.issue type=error;]Error: /usr/bin/xcodebuild failed with return code: 65
##[debug]Processed: ##vso[task.complete result=Failed;]Error: /usr/bin/xcodebuild failed with return code: 65
##[debug]Agent.Version=2.213.2
...

Platforms affected

  • [X] 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
  • [X] macOS 12
  • [ ] Windows Server 2019
  • [ ] Windows Server 2022

Image version and build link

Version: 20221121.1

Is it regression?

No, Xcode 13 runs fine on that same version, but we haven't tried Xcode 14 on a previous version

Expected behavior

I'd expect that Xcode 14.1 will build the project and the pipeline will complete successfully

Actual behavior

The build is failing without any information

Repro steps

We are pushing builds through bitbucket and using web hooks to trigger the pipeline.

Specifying xcodeVersion: '14' fails Specifying xcodeVersion: '13' succeeds

jacobbullock avatar Nov 27 '22 20:11 jacobbullock

Hi! Please provide repro steps

mikhailkoliada avatar Nov 27 '22 20:11 mikhailkoliada

What are you looking for? I mentioned in the ticket that it's a pipeline kicked off from Bitbucket. I can't share the whole pipeline file, but do you need more of it?

jacobbullock avatar Nov 27 '22 21:11 jacobbullock

Same problem here with xcode 14.1 (13 was working fine).

/usr/bin/xcodebuild -sdk iphoneos -configuration Release -workspace /Users/runner/work/1/s/***.xcodeproj/project.xcworkspace -scheme *** archive -destination generic/platform=iOS -verbose CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY=*** PROVISIONING_PROFILE=*** PROVISIONING_PROFILE_SPECIFIER=*** | /usr/local/lib/ruby/gems/3.0.0/bin/xcpretty -r junit --no-color

Results in: ##[error]Error: /usr/bin/xcodebuild failed with return code: 65

flowridr avatar Dec 07 '22 13:12 flowridr

Same issue facing since last month!

pool: vmImage: 'macos-12'

  • task: Xcode@5 inputs: actions: 'build' scheme: sdk: 'iphoneos' configuration: $(environment) xcWorkspacePath: xcodeVersion: 'default' packageApp: true signingOption: manual signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)' provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)' exportPath: '$(Build.BinariesDirectory)'

** BUILD FAILED ** without any information

============================================================================== Task : Xcode Description : Build, test, or archive an Xcode workspace on macOS. Optionally package an app. Version : 5.213.0 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/xcode

/usr/bin/xcodebuild -version Xcode 14.0.1

usmaanirfan avatar Dec 22 '22 12:12 usmaanirfan

Is someone looking into it?

usmaanirfan avatar Dec 23 '22 11:12 usmaanirfan

I'm having the same issue.

Azure task:

         - task: Xcode@5
            displayName: Build application
            inputs:
              actions: 'build'
              configuration: '$(buildConfiguration)'
              sdk: '$(sdk)'
              xcWorkspacePath: 'XXX.xcworkspace'
              scheme: '$(scheme)'
              xcodeVersion: 'specifyPath'
              xcodeDeveloperDir: '/Applications/$(XCODE).app/Contents/Developer'
              packageApp: true
              signingOption: 'manual'
              signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)' 
              provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

Starting: Build application
==============================================================================
Task         : Xcode
Description  : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
Version      : 5.213.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/xcode
==============================================================================
/usr/bin/xcodebuild -version
Xcode 14.1
Build version 14B47b
/usr/bin/xcodebuild -sdk iphoneos -configuration STG-AB Release -workspace /Users/runner/work/1/s/XXX.xcworkspace -scheme STG (AB) build CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY=iPhone Distribution: XXX PROVISIONING_PROFILE=b4cdec1b-2e73-4a32-8b82-249a8da53d32 PROVISIONING_PROFILE_SPECIFIER= | /usr/local/lib/ruby/gems/3.0.0/bin/xcpretty -r junit --no-color
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:B5C4EEE6-6226-42A3-928B-21E0D36FCD36, OS:16.1, name:iPhone 8 }
{ platform:iOS Simulator, id:847F62CA-AE09-4DEE-BC36-8D33FCC704A3, OS:16.1, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:6B3A735F-1C71-4E87-81B6-845410C1D7CB, OS:16.1, name:iPhone 11 }
{ platform:iOS Simulator, id:9B8AE583-31E7-4277-A662-7EDA7E2444B6, OS:16.1, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:8C9A15C0-56C5-4C71-A733-92CC16506142, OS:16.1, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:D1289DA2-CDB0-4F8B-A39D-76AF336D47F3, OS:16.1, name:iPhone 12 }
{ platform:iOS Simulator, id:6ECBACE2-EFF6-42BF-A278-415B922B7ED4, OS:16.1, name:iPhone 12 Pro }
{ platform:iOS Simulator, id:BFAE6FDD-5B69-4668-A0FB-45BD3242EEEF, OS:16.1, name:iPhone 12 Pro Max }
{ platform:iOS Simulator, id:1E2112E3-BC16-4627-8005-2AA1FFDCE782, OS:16.1, name:iPhone 12 mini }
{ platform:iOS Simulator, id:7A519753-05AE-40EB-B9EE-BFABA873B493, OS:16.1, name:iPhone 13 }
{ platform:iOS Simulator, id:A7193A5A-3803-4A67-B132-FD32C7E3646D, OS:16.1, name:iPhone 13 Pro }
{ platform:iOS Simulator, id:477C48D0-BA74-4227-95F4-C0FCCE97BEC8, OS:16.1, name:iPhone 13 Pro Max }
{ platform:iOS Simulator, id:AA17D380-8CB1-4D40-BBE1-03FD156A64C2, OS:16.1, name:iPhone 13 mini }
{ platform:iOS Simulator, id:545D1305-BCA3-486E-A1FA-AD4B25CEEDEC, OS:16.1, name:iPhone 14 }
{ platform:iOS Simulator, id:90F078D0-E324-43B5-A34A-59BBDA089391, OS:16.1, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:155132D6-F7A4-4882-8F2C-7E989A2749FE, OS:16.1, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:5B25630A-F433-4CD7-9120-265EC05BF1CE, OS:16.1, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:60C5261C-4984-4E66-B845-745B77FEF698, OS:16.1, name:iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:C35CBB57-54D4-464B-A435-3AADEB1E5A6A, OS:16.1, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:78B411F0-340C-4095-B43D-D0E6147B361A, OS:16.1, name:iPad (9th generation) }
{ platform:iOS Simulator, id:5E136EC6-9C8A-4562-BF55-E47CECEB750F, OS:16.1, name:iPad (10th generation) }
{ platform:iOS Simulator, id:29ED3BFF-4A4B-4AB2-A162-EE5FD9175AB4, OS:16.1, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:1519B263-65EF-4143-8459-AA2E01E97932, OS:16.1, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:82F956A0-EF55-4370-903A-A63D66C06BDB, OS:16.1, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:06A01833-9806-4D1E-93A9-8771FE6A1448, OS:16.1, name:iPad Pro (11-inch) (3rd generation) }
{ platform:iOS Simulator, id:0357F865-4393-4B47-8155-1D98F73A8A4A, OS:16.1, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:794ABA36-83AD-4919-B982-B56E232E596E, OS:16.1, name:iPad Pro (12.9-inch) (5th generation) }
{ platform:iOS Simulator, id:23A015FB-AAE2-4281-851E-A74B25B4F8AF, OS:16.1, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:59753EA7-7080-46CF-9E49-8A61ABEA20EE, OS:16.1, name:iPad mini (6th generation) }
** BUILD FAILED **

##[error]Error: /usr/bin/xcodebuild failed with return code: 65
Finishing: Build application

shatodj avatar Jan 03 '23 12:01 shatodj

It looks like an issue with Fastlane. No solution so far.

https://github.com/fastlane/fastlane/issues/20825

shatodj avatar Jan 04 '23 07:01 shatodj

This is also happening to me, something is wrong with xcode 14 on azure. Currently, i specify the xcode version to 13 by using xcodeVersion: '13' and it still building fine.

MichaelAmadheo avatar Jan 11 '23 07:01 MichaelAmadheo

We have the same problem on our project, but with one configuration (p12 + mobile provision) it's work but with other it does :

  • The working configuration has setup at 24/11/2022 with a MacOs 11 and work well when build on MacOS 12
  • The other configuration has setup at 06/01/2023 with MacOs 12 and failed when build on MacOS 12

EDIT : After some test, it's probleme of missing configuration in my Podfile (we try to sign the Framework flutter), after downgrade in XCode 13, the error are well show, and after clear it, the build work fine in XCode 14, the final question is why the error does not show in XCode 14 but show well in XCode 13

florentm35 avatar Jan 17 '23 10:01 florentm35

Thanks to @dymv there's a promising repro that works with XCode 13 and fails with XCode 14

It demonstrates the xcodebuild depends on correct combination of 3 options:

  • CODE_SIGN_IDENTITY="Apple Distribution"
  • DEVELOPMENT_TEAM="appleId"
  • CODE_SIGN_STYLE="Manual"
  1. If none provider both builds sucessed
  2. if CODE_SIGN_IDENTITY="Apple Distribution" or CODE_SIGN_IDENTITY="Apple Distribution" DEVELOPMENT_TEAM="_appleId_" are provided xcode 14 fails
  3. if all three CODE_SIGN_IDENTITY="Apple Distribution", DEVELOPMENT_TEAM="_appleId_" and `CODE_SIGN_STYLE="Manual" are provided both builds sucessed

But this repro does not issue the "65 code" error. I suspect it is because the build does not use fastlane which may add some extra options to change the output somehow.

dsame avatar Jan 24 '23 18:01 dsame

If anyone was having problems with this running this way worked for me:

- task: Xcode@5
    displayName: 'Build IPA'
    inputs:
      actions: 'clean'
      configuration: 'Release'
      exportOptionsPlist: '$(IOS_FOLDER)/nativeApp/Info.plist'
      sdk: 'iphoneos'
      xcWorkspacePath: '$(IOS_FOLDER)/nativeApp.xcworkspace'
      scheme: 'nativeApp'
      packageApp: true
      exportPath: 'output'
      signingOption: 'manual'
      signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
      provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
      args: 'ENABLE_BITCODE=NO'

Important to note here is that if I specify xcodeVersion: '14' the build will run on 14.2, at this date, and fail. But if I do not pass the xcodeVersion, it runs on 14.2 and pass.

tulio-mcsantos avatar Mar 10 '23 12:03 tulio-mcsantos

We had the same issue (error 65 and no meaningful error message) and a solution for us was to move some of the libs from SPM to CocoaPods. That might be a hint to some of you.

darecki avatar Mar 22 '23 12:03 darecki

@darecki our problem was spm related as well. It was trying to sign local packages and failing. The trick there is to change the Xcode part of the pipeline to archive first and then export and sign with entitlements.

jacobbullock avatar Mar 22 '23 13:03 jacobbullock

The issue is closed because it is not related to the runner images repo. The root cause is the incompatibility between XCode 13/14 and there's no common solution for the different build scenarios.

The comment https://github.com/actions/runner-images/issues/6642#issuecomment-1402377143 points out the way to start solving the problem in specific case.

dsame avatar Mar 26 '23 18:03 dsame

For those who are still lost, this is what helped me:

  • first: disable useXPretty so you can see the actual error
  • if there is a problem with signing the app (or signing your SPM packages/pods) disable manual or automatic signing and use the project default
  • Sign app using exportOptionsPlist

Here is my Azure pipeline task which now works

          - task: Xcode@5
            displayName: Build application
            inputs:
              actions: 'build'
              configuration: '$(buildConfiguration)'
              sdk: '$(sdk)'
              xcWorkspacePath: 'APP.xcworkspace'
              scheme: '$(scheme)'
              xcodeVersion: 'specifyPath'
              xcodeDeveloperDir: '/Applications/Xcode_14.2.app/Contents/Developer'
              packageApp: true
              destinationTypeOption: devices
              args: '-verbose"'
              signingOption: 'default'
              useXcpretty: true # or `false` if you want to see hidden errors
              exportOptions: 'plist'
              exportOptionsPlist: 'PATH/TO/YOUR/exportOptions.plist'

and this is a sample of my exportOptions.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>provisioningProfiles</key>
	<dict>
		<key>com.app.app</key>
		<string>The Name of my Distribution Certificate from Xcode project</string>
	</dict>
	<key>signingStyle</key>
	<string>manual</string>
	<key>teamId</key>
	<string>XXXXXX</string>
	<key>method</key>
	<string>enterprise</string>
</dict>
</plist>

shatodj avatar May 16 '23 13:05 shatodj

I resolved this issue by updating the agent in my pipeline yaml to macOS 13:

pool:
  vmImage: macos-13

I let it use the default version of Xcode (omit xcodeVersion) and it used Xcode 14.2. This allowed my build to succeed.

inorganik avatar Jul 19 '23 21:07 inorganik

I resolved this issue by updating the agent in my pipeline yaml to macOS 13:

pool:
  vmImage: macos-13

I let it use the default version of Xcode (omit xcodeVersion) and it used Xcode 14.2. This allowed my build to succeed.

That worked for a bit, but now Azure Devops updated the macOS version from 13.4 to 13.5 and it stopped working. Any luck with solving it this time?

DavidGregor-Net avatar Aug 03 '23 16:08 DavidGregor-Net

From Monday July 31st - Tuesday Aug 1st - Azure Devops updated the macOS version from 13.4 to 13.5 and now my pipeline builds for validating unit testing are double in times. Why is 13.5 running the compiling of the Xcode app slower? This complete validate step use to take 18min and now its timing out and takes 24min just to finish compiling before it execute the tests.

mikebrown75 avatar Aug 14 '23 12:08 mikebrown75