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

[BUG]: /usr/bin/xcodebuild failed with return code: 65 #19405

Closed
7 tasks
iCodeWoods opened this issue Dec 26, 2023 · 24 comments
Closed
7 tasks

[BUG]: /usr/bin/xcodebuild failed with return code: 65 #19405

iCodeWoods opened this issue Dec 26, 2023 · 24 comments
Labels
Area: ABTT Akvelon Build Tasks Team area of work Area: Release bug Task: Xcode

Comments

@iCodeWoods
Copy link

New issue checklist

Task name

Xcode

Task version

5.231.5

Issue Description

/usr/bin/xcodebuild failed with return code: 65 before build.

But locally build is successful.
But locally build is successful.
But locally build is successful.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Mac mini Apple M2 14.1.2 (23B92)

Relevant log output

2023-12-26T07:52:14.2445200Z (2 failures)
2023-12-26T07:52:14.6374690Z ##[error]Error: The process '/usr/bin/xcodebuild' failed with exit code 65
2023-12-26T07:52:14.6988300Z ##[section]Finishing: Xcode archive

Full task logs with system.debug enabled

No response

Repro steps

No response

@iCodeWoods iCodeWoods added the bug label Dec 26, 2023
@github-actions github-actions bot added Area: Release triage Area: ABTT Akvelon Build Tasks Team area of work Task: Xcode labels Dec 26, 2023
@kirill-ivlev
Copy link
Contributor

Hi @iCodeWoods,
Thank you for raising this question,
Usually, Error code 65 indicates problems with the signing of the application.

Could you please, provide more details about your inputs and signing configuration?
Do you have a minimal project which will help us to reproduce your issue?

@iCodeWoods
Copy link
Author

Hi @kirill-ivlev , I believe it's not a problem with signing because it fails quickly even before starting the compilation. We have four build machines: one is normal (indicating the project itself is fine), while the other three machines fail before the compilation starts. I don't have a minimal project.

This issue has persisted for a long time. Since we have one successful machine, it doesn't block our release. However, there are occasions when we need to wait if we want to have two or more builds simultaneously.

@kirill-ivlev
Copy link
Contributor

@iCodeWoods, on that machine, where you build failing from the Azure agent, are you able to build it from the terminal?

@iCodeWoods
Copy link
Author

@kirill-ivlev Yes, success can be achieved by using the same command that was copied from the agent to the local terminal.

@Muhammed9991
Copy link

I'm having a similar issue. Fails quite quickly. If you're using command line directly, it does build but with Xcode@5 task it does not.

I've only started noticing this since adopting Swift macros. In order to use swift macros. I have followed the steps to enable macro usage. You can either pass in a compiler flag -skipMacroValidation or update the global settings using defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES.

@eoinnorris
Copy link

I am also seeing this:

The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues.
Pipeline builds that worked a few weeks ago now fail if we re-run them.

@iCodeWoods
Copy link
Author

I'm having a similar issue. Fails quite quickly. If you're using command line directly, it does build but with Xcode@5 task it does not.

I've only started noticing this since adopting Swift macros. In order to use swift macros. I have followed the steps to enable macro usage. You can either pass in a compiler flag -skipMacroValidation or update the global settings using defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES.

@Muhammed9991 Thanks, but we didn't use SwiftMacro.

@iCodeWoods
Copy link
Author

I am also seeing this:

The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

@eoinnorris This sounds strange; didn't signing happen in the very last stage?

@eoinnorris
Copy link

I am also seeing this:
The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

@eoinnorris This sounds strange; didn't signing happen in the very last stage?

yes is is strange.

--- 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:DA40344C-ACB5-4AE2-B404-1182E52988A0, OS:17.0.1, name:iPad (10th generation) }
{ platform:iOS Simulator, id:726CC9EA-5F92-4F24-8DFA-4F2A339C3B14, OS:17.2, name:iPad (10th generation) }
{ platform:iOS Simulator, id:9E396783-8F2B-485F-8EB0-43DB3E07AAD3, OS:17.0.1, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:EA3E14E6-16FC-4DF3-B6D8-1F35F09E1B81, OS:17.2, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:38B402A4-7518-4D0B-8BC1-B0F7C8037FAC, OS:17.0.1, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:9E6D4867-E816-43EA-9CD3-56492E02D1EA, OS:17.2, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:51CD280D-E0EB-4583-B21B-24FA6608C729, OS:17.0.1, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:5DC953A8-0AA4-4153-9BAE-4C8995BCEDDB, OS:17.2, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:D5AFB2DE-B3D2-401F-982A-A046CE56464C, OS:17.0.1, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:E33ADD5B-1FC4-44FA-A4FF-A8CB5D7F7AF0, OS:17.2, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:3CD78D7C-901A-41E4-9275-754B81B15105, OS:17.0.1, name:iPhone 14 }
{ platform:iOS Simulator, id:59B12573-9054-4816-BB58-9377F9400F1C, OS:17.2, name:iPhone 14 }
{ platform:iOS Simulator, id:2E807556-B6A2-44D7-B6E7-FDD4C481BA16, OS:17.0.1, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:912FE505-2509-4A37-A16C-A26FBB40B3C0, OS:17.2, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:43CFCB94-698F-4D2B-ABDC-E3B8BA97A8F5, OS:17.0.1, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:3AADBC2A-153E-4B0A-9A78-9943D08688BF, OS:17.2, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:01391579-D9A3-4C9C-8483-82DA9D2E4758, OS:17.0.1, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:6AA76502-DA74-40ED-9C54-5F9B1E270FE6, OS:17.2, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:D52D06F0-70A3-44E8-BDA9-7C895BE96799, OS:17.0.1, name:iPhone 15 }
{ platform:iOS Simulator, id:C558DB64-6D1B-439C-A302-8B07E81570F2, OS:17.2, name:iPhone 15 }
{ platform:iOS Simulator, id:E8535C9F-4708-4C56-84C2-70678668DC5E, OS:17.0.1, name:iPhone 15 Plus }
{ platform:iOS Simulator, id:0D39692E-D81E-4B5C-95C3-A80D11065A3E, OS:17.2, name:iPhone 15 Plus }
{ platform:iOS Simulator, id:AD62461A-EF69-44A3-A518-A11E088DBC4E, OS:17.0.1, name:iPhone 15 Pro }
{ platform:iOS Simulator, id:637EDCC8-73B3-420D-836A-A60DDDA9C02B, OS:17.2, name:iPhone 15 Pro }
{ platform:iOS Simulator, id:9D384CAE-E0EB-454D-BA44-BFF2034A17B2, OS:17.0.1, name:iPhone 15 Pro Max }
{ platform:iOS Simulator, id:E14D5F90-2BCE-4197-A43D-7CC6AF84BE66, OS:17.2, name:iPhone 15 Pro Max }
{ platform:iOS Simulator, id:CB1E153B-77E4-4D0D-998B-0AF4A5D06F81, OS:17.0.1, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:33E68A9F-2C2B-4E76-A5C3-040D4C7CE107, OS:17.2, name:iPhone SE (3rd generation) }
** BUILD FAILED **

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

@Panda-Sharp
Copy link

Panda-Sharp commented Jan 22, 2024

I am also seeing this:

The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

We're also seeing the same issue, adding to @eoinnorris that not only the commit it's exactly the same (including the app and yaml pipeline code), but also the agent OS and image versions are exactly the same

Operating System
macOS
13.6.3
22G436
Runner Image
Image: macos-13
Version: 20240114.1

Till the 12th of January worked and now starting from the 19th of January is throwing
##[error]Error: /usr/bin/xcodebuild failed with return code: 65

Also if it can help, yes the error appears at the "start of compilation", but still after 4/5 minutes the task started to run

P.s.
we double checked that certificate and provision profiles are still valid already

@Panda-Sharp
Copy link

I am also seeing this:
The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

We're also seeing the same issue, adding to @eoinnorris that not only the commit it's exactly the same (including the app and yaml pipeline code), but also the agent OS and image versions are exactly the same

Operating System
macOS
13.6.3
22G436
Runner Image
Image: macos-13
Version: 20240114.1

Till the 12th of January worked and now starting from the 19th of January is throwing ##[error]Error: /usr/bin/xcodebuild failed with return code: 65

Also if it can help, yes the error appears at the "start of compilation", but still after 4/5 minutes the task started to run

P.s. we double checked that certificate and provision profiles are still valid already

Apologies for the confusion, after extensive debugging, we figure the issue out, devs pointed some swift packages to main branch instead of using a release version, all works good now, thanks!

@iCodeWoods
Copy link
Author

I am also seeing this:

The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

Hi @eoinnorris , Are you still facing this issue, or have you resolved it? I tried using a new .p12, but it still fails at the beginning of the build.

@iCodeWoods
Copy link
Author

I am also seeing this:
The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

We're also seeing the same issue, adding to @eoinnorris that not only the commit it's exactly the same (including the app and yaml pipeline code), but also the agent OS and image versions are exactly the same

Operating System
macOS
13.6.3
22G436
Runner Image
Image: macos-13
Version: 20240114.1

Till the 12th of January worked and now starting from the 19th of January is throwing ##[error]Error: /usr/bin/xcodebuild failed with return code: 65
Also if it can help, yes the error appears at the "start of compilation", but still after 4/5 minutes the task started to run
P.s. we double checked that certificate and provision profiles are still valid already

Apologies for the confusion, after extensive debugging, we figure the issue out, devs pointed some swift packages to main branch instead of using a release version, all works good now, thanks!

In your case, there does seem to be an error, but it's only displaying '/usr/bin/xcodebuild' failed with exit code 65 without providing specific error information. Is there a way we can enhance the details of this error? @kirill-ivlev

@eoinnorris
Copy link

I am also seeing this:
The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

Hi @eoinnorris , Are you still facing this issue, or have you resolved it? I tried using a new .p12, but it still fails at the beginning of the build.

add args: '-verbose' to get more output.

In our case some of our SPM libraries had updated to change their Xcode project files, both the reachability and realm project did something, it looks like they added a security markdown at the least.

What we found was that the build failed on the pipeline but not on our local builds which mimic the pipeline build exactly.

Without knowing the full underlying cause it looks like code signing failed because of additional assets in the framework -- the security file I assume. You get this with the verbose log.

It looks like this works with Xcode 15.x on macOS 14.x but not for Xcode running on pre Sonoma. The pipeline uses Ventura as the latest OS, presumably they do this until Ventura is not supported anymore, at which time it will magically fix itself. In the meantime look at recent updates in your SPM list ( or Cocoa pods or whatever you use)

@iCodeWoods
Copy link
Author

Fixed. We did have some SwiftUI previews in one of our kit and that can apparently cause issues if Swift 5.9 is not installed on the build machines.

@pradeep-tiger
Copy link

Fixed. We did have some SwiftUI previews in one of our kit and that can apparently cause issues if Swift 5.9 is not installed on the build machines.

Can you help me to install Swift 5.9 on build machines? Thanks in advance.

@Valentin-Pommee-Macaw
Copy link

Valentin-Pommee-Macaw commented Mar 23, 2024

I am also seeing this:
The error occurs at the very start of compilation, however it possibly is a signing issue because if we turn signing off the compile continues. Pipeline builds that worked a few weeks ago now fail if we re-run them.

@eoinnorris This sounds strange; didn't signing happen in the very last stage?

yes is is strange.

--- 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:DA40344C-ACB5-4AE2-B404-1182E52988A0, OS:17.0.1, name:iPad (10th generation) }
{ platform:iOS Simulator, id:726CC9EA-5F92-4F24-8DFA-4F2A339C3B14, OS:17.2, name:iPad (10th generation) }
{ platform:iOS Simulator, id:9E396783-8F2B-485F-8EB0-43DB3E07AAD3, OS:17.0.1, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:EA3E14E6-16FC-4DF3-B6D8-1F35F09E1B81, OS:17.2, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:38B402A4-7518-4D0B-8BC1-B0F7C8037FAC, OS:17.0.1, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:9E6D4867-E816-43EA-9CD3-56492E02D1EA, OS:17.2, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:51CD280D-E0EB-4583-B21B-24FA6608C729, OS:17.0.1, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:5DC953A8-0AA4-4153-9BAE-4C8995BCEDDB, OS:17.2, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:D5AFB2DE-B3D2-401F-982A-A046CE56464C, OS:17.0.1, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:E33ADD5B-1FC4-44FA-A4FF-A8CB5D7F7AF0, OS:17.2, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:3CD78D7C-901A-41E4-9275-754B81B15105, OS:17.0.1, name:iPhone 14 }
{ platform:iOS Simulator, id:59B12573-9054-4816-BB58-9377F9400F1C, OS:17.2, name:iPhone 14 }
{ platform:iOS Simulator, id:2E807556-B6A2-44D7-B6E7-FDD4C481BA16, OS:17.0.1, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:912FE505-2509-4A37-A16C-A26FBB40B3C0, OS:17.2, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:43CFCB94-698F-4D2B-ABDC-E3B8BA97A8F5, OS:17.0.1, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:3AADBC2A-153E-4B0A-9A78-9943D08688BF, OS:17.2, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:01391579-D9A3-4C9C-8483-82DA9D2E4758, OS:17.0.1, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:6AA76502-DA74-40ED-9C54-5F9B1E270FE6, OS:17.2, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:D52D06F0-70A3-44E8-BDA9-7C895BE96799, OS:17.0.1, name:iPhone 15 }
{ platform:iOS Simulator, id:C558DB64-6D1B-439C-A302-8B07E81570F2, OS:17.2, name:iPhone 15 }
{ platform:iOS Simulator, id:E8535C9F-4708-4C56-84C2-70678668DC5E, OS:17.0.1, name:iPhone 15 Plus }
{ platform:iOS Simulator, id:0D39692E-D81E-4B5C-95C3-A80D11065A3E, OS:17.2, name:iPhone 15 Plus }
{ platform:iOS Simulator, id:AD62461A-EF69-44A3-A518-A11E088DBC4E, OS:17.0.1, name:iPhone 15 Pro }
{ platform:iOS Simulator, id:637EDCC8-73B3-420D-836A-A60DDDA9C02B, OS:17.2, name:iPhone 15 Pro }
{ platform:iOS Simulator, id:9D384CAE-E0EB-454D-BA44-BFF2034A17B2, OS:17.0.1, name:iPhone 15 Pro Max }
{ platform:iOS Simulator, id:E14D5F90-2BCE-4197-A43D-7CC6AF84BE66, OS:17.2, name:iPhone 15 Pro Max }
{ platform:iOS Simulator, id:CB1E153B-77E4-4D0D-998B-0AF4A5D06F81, OS:17.0.1, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:33E68A9F-2C2B-4E76-A5C3-040D4C7CE107, OS:17.2, name:iPhone SE (3rd generation) }
** BUILD FAILED **

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

I am still having the same issue... I am not very familiar with apple/xcode development, my project uses Ionic/capacitor.. please help! (certificates are all valid, I checked that)

This is my release pipeline:
image

@FauxObsolete
Copy link

FauxObsolete commented May 14, 2024

hi @Valentin-Pommee-Macaw did you find a resolution by any chance ? I have also been setting up a pipeline for an Ionic build and am stuck banging my head on this same 65 error code...

@Valentin-Pommee-Macaw
Copy link

Hey @FauxObsolete,
this is a bit embarassing, but i actually did make a mistake with my certificate and provisioning profile... resolved it by correctly re-generating new ones using the developer account i used to publish my app with from xcode.

@FauxObsolete
Copy link

thanks for the reply @Valentin-Pommee-Macaw.
I believe a co-worker has just identified our issue too - and it is with the escaping of spaces in the signing Identity name.... so a little embarrassing here too!

@otiv33
Copy link

otiv33 commented May 22, 2024

Anyone having also this problem. We had a script that modified the capacitor project project for multiple tenants, but we forgot to replace the applicationIdentifier in the project.pbxproj file. Since the applicationIdentifier was wrong we got this error only in our build pipeline.
However building on our local machine worked perfectly fine, hence threw quite some time into researching this issue since it was not really that self descriptive what is wrong. Hope this helps anyone

@Mairramer
Copy link

@otiv33 It's not my case, he's correct. Could a wrong configuration regarding the use of flavors cause this? (I refer to the configuration in the pipeline)

@khayargoli
Copy link

khayargoli commented Dec 13, 2024

2024-12-13T09:58:37.5391350Z Run script build phase '[CP] Embed Pods Frameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'App' from project 'App')
2024-12-13T09:58:37.5698460Z ** BUILD FAILED **
2024-12-13T09:58:37.6005960Z ##[error]Error: /usr/bin/xcodebuild failed with return code: 65
2024-12-13T09:58:37.6013900Z ##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId=9903cf4f-2022-4b0c-84ab-7f6cab6f53ed;]Error: /usr/bin/xcodebuild failed with return code: 65
2024-12-13T09:58:37.6015690Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: /usr/bin/xcodebuild failed with return code: 65
2024-12-13T09:58:37.6016420Z ##[debug]Agent.Version=3.248.0

I get this error, How to find out the cause??

@khayargoli
Copy link

Anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work Area: Release bug Task: Xcode
Projects
None yet
Development

No branches or pull requests