bitrise-steplib / steps-xcode-archive

Xcode Archive for iOS step
MIT License
68 stars 56 forks source link

Archive failed, error: exit status 65 #312

Closed tthejus closed 8 months ago

tthejus commented 2 years ago

Troubleshooting

Issue description

I have multiple workflows configured for different Environment. While the app builds successfully for preprod prod and recette qa workflows, it only fails for recette work flow with the following error.

The archive runs successfully when using Xcode 13.0.x stack but fails when using Xcode13.4.x, Xcode14.X and so on. Problem only on Recette workflow. Tried to duplicate a working workflow and use it as a recette workflow, but I have the same error. Certificates and profiles seems valid.

Archive is successful when locally Archiving on Xcode.

Bitrise info

 ** ARCHIVE FAILED **
The following build commands failed:
    Run custom shell script 'Run Script'
(1 failure)
You can find the last couple of lines of Xcode's build log above, but the full log is also available in the raw-xcodebuild-output.log
    The log file is stored in $BITRISE_DEPLOY_DIR, and its full path is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable
    (value: /Users/vagrant/deploy/raw-xcodebuild-output.log)
Archive failed, error: exit status 65```
  
galahador commented 2 years ago

I have the same problem, but in my case, Xcode13.0.x has the same problem. Also for some reason 80% of files. . . Screen Shot 2022-10-07 at 13 10 09

akucharczyk commented 2 years ago

Did some of you got a work around? I get the same error on xcode 14 and xcode 13.4.

image

jgodonQobuz commented 2 years ago

Hello there !

I think I've the same issue and this is really problematic 😰

This bug just appears now that I'm moving my project from a Xcode project project.xcodeproj (where this workflow runs well) to a workspace project.xcworkspace that I need for several reasons...

I've update path as it should be in all workflow configurations... tried a lot of things but still this weird command failed with exit status 65

Any clue or things to do to learn more about this strange error ?

Thanks a lot for your answer

Failed to execute Step main logic:
  failed to archive the project:
    command failed with exit status 65 (set -o pipefail && xcodebuild "archive" "-workspace" "/Users/[REDACTED]/git/Qobuz.xcworkspace" "-scheme" "Qobuz-AdHoc" "-xcconfig" "/var/folders/9l/1ysg9vq51p37q0lgksxhdb9r0000gn/T/1132930427/temp.xcconfig" "-archivePath" "/var/folders/9l/1ysg9vq51p37q0lgksxhdb9r0000gn/T/xcodeArchive594967407/Qobuz.xcarchive" "-destination" "generic/platform=iOS" | xcpretty)

Xcode 14.x.x

DamienBitrise commented 2 years ago

Run custom shell script 'Run Script'

Looks like there is an issue with your Run Script

warning: Run script build phase 'Create Symlinks to Header Folders' 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 'PromisesObjC' from project 'Pods')
** ARCHIVE FAILED **

The following build commands failed:
    Run custom shell script 'Run Script'
DamienBitrise commented 2 years ago

Also for some reason 80% of files. . .

This likely means you have a secret with the value of vagrant set

tthejus commented 2 years ago

@DamienBitrise Do you have some inputs on my actual problem ? It would be great to advance on it. Still blocked by this issue.

jgodonQobuz commented 2 years ago

For my part, this was a Swift Lint Build phase error that was not clearly logged but the problem was coming from it... Thanks for help and have a good day

Fallom25 commented 2 years ago

@DamienBitrise Do you have some inputs on my actual problem ? It would be great to advance on it. Still blocked by this issue.

Hey @tthejus I have the same problem I used this guide and it works now. https://www.bigbinary.com/books/learn-react-native/handling-environment-specific-configurations-in-react-native

dotdotcommadot commented 1 year ago

Having the same problem on my Flutter project, after upgrading to Xcode 14

Hamasn commented 1 year ago

I also have the same problem, I am able to build with Bitrise with version xcode 14.0.1, but when use 14.1, it will be failed. and Archive failed, error: exit status 65 any tips? @bitrise-team

it is native iOS project with SPM only, no cocodpods and carthage.

Alserk commented 1 year ago

We also have the same problem using xcode version 13.4. Everything worked great until today. Today it returns issue command failed with exit status 65 (set -o pipefail && xcodebuild "archive" "-workspace"

ThulaniMtetwa-Discovery commented 1 year ago

How can I resolve this for my project?

shahla-hafez commented 1 year ago

Same error here

juanOntiveros commented 1 year ago

Any one could fix this issue? We are getting the exact same error with XCode 14.2

sukesh-pfx commented 1 year ago

Any updates? Same issue for me Stack and machine type

Xcode 14.1.x, on macOS 13.2 (Ventura) Intel Medium

image
woliwa1 commented 1 year ago

I met the same problem as you. How did you solve it?

anhlq-supp commented 1 year ago

I'm getting the same error today, has anyone resolved the issue?


  failed to archive the project:
    command failed with exit status 65 (xcodebuild "archive" "-workspace" "/Users/[REDACTED]/git/****.xcworkspace" "-scheme" "****" "-xcconfig" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/4186808971/temp.xcconfig" "-archivePath" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/xcodeArchive3739832971/****.xcarchive" "-destination" "generic/platform=iOS" "-skipPackagePluginValidation"):
      /Users/[REDACTED]/git/****Mutation.graphql.swift:35:12: error: initializer 'init(data:)' has different argument labels from those required by protocol 'SelectionSet' ('init(_dataDict:)') (exit code: 1)```
bitrise-silver commented 1 year ago

Hi everyone, exit status 65 can mean a lot of things related to Xcode archive process. I would kindly ask you do open support tickets so that you can be guided through case by case.

liplylie commented 1 year ago

Getting this as well:

The following build commands failed: PhaseScriptExecution ... in target 'FBReactNativeSpec' from project 'Pods'

command failed with exit status 65

xcode 14.1.x, on macOS 13.2 (Ventura) M1 Medium

Was working previously when using xcode 13.x Monterey

liplylie commented 1 year ago

Was able to resolve this by installing the nvm version step and using node version 16.19.0.

bitrise-coresteps-bot commented 1 year ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

johannamelly commented 1 year ago

I got the same error today with Xcode 14.3.x on macOS 13.2 (Ventura). I also tried with Xcode 15 but had the exact same issue. Has anyone solved this?

Failed to execute Step main logic:
  failed to archive the project:
    command failed with exit status 65 (set -o pipefail && xcodebuild "archive" "-workspace" "/Users/[REDACTED]/git/ios/xxx.xcworkspace" "-scheme" "xxx" "-xcconfig" "/var/folders/yy/6kcn9mkd5svdbqnznwf474f00000gn/T/3208615793/temp.xcconfig" "-archivePath" "/var/folders/yy/6kcn9mkd5svdbqnznwf474f00000gn/T/xcodeArchive240265980/xxx.xcarchive" "-allowProvisioningUpdates" "-destination" "generic/platform=iOS" [REDACTED] xcpretty)
anhlq-supp commented 1 year ago

I'm getting the same error today, has anyone resolved the issue?

  failed to archive the project:
    command failed with exit status 65 (xcodebuild "archive" "-workspace" "/Users/[REDACTED]/git/****.xcworkspace" "-scheme" "****" "-xcconfig" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/4186808971/temp.xcconfig" "-archivePath" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/xcodeArchive3739832971/****.xcarchive" "-destination" "generic/platform=iOS" "-skipPackagePluginValidation"):
      /Users/[REDACTED]/git/****Mutation.graphql.swift:35:12: error: initializer 'init(data:)' has different argument labels from those required by protocol 'SelectionSet' ('init(_dataDict:)') (exit code: 1)```

My case was caused by different library version between bitrise machine and my local machine. Solved it by pointing at specific version for every external library in my SPM. Hope this could help if you're in the same scenario.

RichardLima commented 1 year ago

I'm getting the same error today, has anyone resolved the issue?

  failed to archive the project:
    command failed with exit status 65 (xcodebuild "archive" "-workspace" "/Users/[REDACTED]/git/****.xcworkspace" "-scheme" "****" "-xcconfig" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/4186808971/temp.xcconfig" "-archivePath" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/xcodeArchive3739832971/****.xcarchive" "-destination" "generic/platform=iOS" "-skipPackagePluginValidation"):
      /Users/[REDACTED]/git/****Mutation.graphql.swift:35:12: error: initializer 'init(data:)' has different argument labels from those required by protocol 'SelectionSet' ('init(_dataDict:)') (exit code: 1)```

My case was caused by different library version between bitrise machine and my local machine. Solved it by pointing at specific version for every external library in my SPM. Hope this could help if you're in the same scenario.

How did you notice that? Which library is this related to? tks

RichardLima commented 1 year ago

In my case, I fixed it after analyzing: xcodebuild-archive.log, and identified that the bitrise machine started to use an updated node version and that it has the problem: openssl-legacy-provider. :)

johannamelly commented 1 year ago

Hi, thanks for your answers!

In my case, I fixed it after analyzing: xcodebuild-archive.log, and identified that the bitrise machine started to use an updated node version and that it has the problem: openssl-legacy-provider. :)

It was exactly my problem! My node version was older so it was working fine locally, but not on Bitrise. I set a NODE_OPTIONS to --openssl-legacy-provider in the Env Vars, and now everything is working well :)

tomascenteno42 commented 1 year ago

Any news regarding this issue? All my builds are failing ):

bitrise-silver commented 1 year ago

Hello everyone, Bitrise build machines have various NodeJs versions so you need to lock down to the exact version your project expects.

asdf install nodejs <version>
asdf global nodejs <version>

I also recommend you to commit yarn.lock or npm-package.lock then put NodeJs version in your package.json so that you can be notified if the versions in the build machine and your project are mismatched. Error 65 is a generic error when archiving, you are welcome to submit support requests for Bitrise to look into your particular cases.

bitrise-coresteps-bot commented 9 months ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

bitrise-coresteps-bot commented 8 months ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.