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

ARCHIVE FAILED: Exit status: 65, Gym failed #20130

Open
moz134 opened this issue Mar 28, 2022 · 36 comments
Open

ARCHIVE FAILED: Exit status: 65, Gym failed #20130

moz134 opened this issue Mar 28, 2022 · 36 comments

Comments

@moz134
Copy link

moz134 commented Mar 28, 2022

I am able to build archive using xcode successfully.
When i run $ fastane do_everything_dev

i get below error for last 5 days. The same code was working before without any code change.
ARCHIVE FAILED **
[19:55:48]: Exit status: 65

+---------------+-------------------------+
| Build environment |
+---------------+-------------------------+
| xcode_path | /Applications/Xcode.app |
| gym_version | 2.205.1 |
| export_method | ad-hoc |
| sdk | iPhoneOS15.2.sdk |
+---------------+-------------------------+

[19:55:48]: ▸ cd /Users/mdmozammil/core/productapp/ios-mobiquity-consumer-core-app
[19:55:48]: ▸ /usr/bin/touch -c /Users/mdmozammil/Library/Developer/Xcode/DerivedData/MobiquityConsumer-gwhebhwduquhohgsnwhfrgwhxoku/Build/Intermediates.noindex/ArchiveIntermediates/DEV/InstallationBuildProductsLocation/Applications/mobiquity\ Pay\ DEV.app
[19:55:48]: ▸ /Users/mdmozammil/core/productapp/ios-mobiquity-consumer-core-app/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'SwiftEventBus' from project 'Pods')
[19:55:48]: ▸ /Users/mdmozammil/core/productapp/ios-mobiquity-consumer-core-app/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'FSCalendar' from project 'Pods')
[19:55:48]:
[19:55:48]: ⬆️ Check out the few lines of raw xcodebuild output above for potential hints on how to solve this error
[19:55:48]: 📋 For the complete and more detailed error log, check the full log at:
[19:55:48]: 📋 /Users/mdmozammil/Library/Logs/gym/mobiquity Pay-DEV.log
[19:55:48]:
[19:55:48]: Looks like fastlane ran into a build/archive error with your project
[19:55:48]: It's hard to tell what's causing the error, so we wrote some guides on how
[19:55:48]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[19:55:48]: Before submitting an issue on GitHub, please follow the guide above and make
[19:55:48]: sure your project is set up correctly.
[19:55:48]: fastlane uses xcodebuild commands to generate your binary, you can see the
[19:55:48]: the full commands printed out in yellow in the above log.
[19:55:48]: Make sure to inspect the output above, as usually you'll find more error information there
[19:55:48]:
+------------------+-----------------------+
| Lane Context |
+------------------+-----------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios do_everything_dev |
| BUILD_NUMBER | 20 |
+------------------+-----------------------+
[19:55:48]: Error building the application - see the log above

+------+------------------------+-------------+
| fastlane summary |
+------+------------------------+-------------+
| Step | Action | Time (in s) |
+------+------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | Switch to ios clean | 0 |
| | lane | |
| 3 | clear_derived_data | 0 |
| 4 | Switch to ios | 0 |
| | build_beta_dev lane | |
| 5 | automatic_code_signin | 0 |
| | g | |
| 6 | increment_build_numbe | 2 |
| | r | |
| 💥 | gym | 650 |
+------+------------------------+-------------+

[19:55:48]: fastlane finished with errors

[!] Error building the application - see the log above

MCKL-7364:ios-mobiquity-consumer-core-app mdmozammil$ fastlane env
[✔] 🚀
[20:12:47]: fastlane detected a Gemfile in the current directory
[20:12:47]: However, it seems like you didn't use bundle exec
[20:12:47]: To launch fastlane faster, please use
[20:12:47]:
[20:12:47]: $ bundle exec fastlane env
[20:12:47]:
[20:12:47]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[20:12:49]: Generating fastlane environment output, this might take a few seconds...
swift-driver version: 1.26.21

🚫 fastlane environment 🚫

Stack

Key Value
OS 12.2.1
Ruby 2.6.8
Bundler? false
Git git version 2.32.0 (Apple Git-132)
Installation Source /usr/local/bin/fastlane
Host macOS 12.2.1 (21D62)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 13.2.1
Swift Version 5.5.2

System Locale

Error
No Locale with UTF8 found 🚫

fastlane files:

`./fastlane/Fastfile`
default_platform(:ios)

platform :ios do

desc "clean"
lane :clean do
  clear_derived_data(derived_data_path: "./fastlane/builds/")
end

  desc "Create dev ipa"
  lane :build_beta_dev do
    enable_automatic_code_signing
    increment_build_number
    gym(scheme: "DEV")
  end

  desc "Upload dev to Firebase"
  lane :upload_firebase_dev do
  firebase_app_distribution(
    ipa_path: "./fastlane/builds/mobiquity Pay.ipa",
    app: "<Firebase app id>",
    groups: "<groupname>",
    release_notes: "Mobiquity Subscriber DEV"
  )
end


desc "Create uat ipa"
  lane :build_beta_uat do
    enable_automatic_code_signing
    increment_build_number
    gym(scheme: "UAT")
  end

  desc "Upload uat to Firebase"
  lane :upload_firebase_uat do
  firebase_app_distribution(
    ipa_path: "./fastlane/builds/mobiquity Pay.ipa",
    app: "<Firebase app id>",
    groups: "<groupname>",
    release_notes: "Mobiquity Subscriber UAT",
  )
end

desc "Create aws ipa"
  lane :build_beta_aws do
    enable_automatic_code_signing
    increment_build_number
    gym(scheme: "PVG")
  end

  desc "Upload dev to Firebase"
  lane :upload_firebase_aws do
  firebase_app_distribution(
    ipa_path: "./fastlane/builds/mobiquity Pay PVG.ipa",
    app: "<Firebase app id>",
    groups: "<groupname>",
    release_notes: "Mobiquity Consumer AWS"
  )
end

desc "build and upload dev to firebase"
  lane :do_everything_dev do
      clean
      build_beta_dev
      upload_firebase_dev
  end

desc "build and upload uat to firebase"
  lane :do_everything_uat do
      clean
      build_beta_uat
      upload_firebase_uat
  end

desc "build and upload aws to firebase"
  lane :do_everything_aws do
      clean
      build_beta_aws
      upload_firebase_aws
  end

end
`./fastlane/Appfile`
  app_identifier(ENV['BUNDLE_IDENTIFIER']) # The bundle identifier of your app
  apple_id("<email.com>") # Your Apple email address
  team_name ("<Name>")


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.205.1 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-firebase_app_distribution 0.3.3 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
atomos 0.1.3
claide 1.1.0
colored2 3.1.2
nanaimo 0.3.0
rexml 3.2.5
xcodeproj 1.21.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
plist 3.6.0
public_suffix 4.0.6
addressable 2.8.0
multipart-post 2.0.0
word_wrap 1.0.0
optparse 0.1.1
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
faraday-multipart 1.0.3
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.0
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.4
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.6
gh_inspector 1.1.3
mini_magick 4.11.0
naturally 2.2.1
rubyzip 2.3.2
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.7.6
bundler 1.17.2
simctl 1.6.8
jwt 2.3.0
uber 0.1.0
declarative 0.0.20
trailblazer-option 0.1.2
representable 3.1.1
retriable 3.1.2
mini_mime 1.1.2
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.16.1
googleauth 1.1.2
httpclient 2.8.3
google-apis-core 0.4.2
google-apis-playcustomapp_v1 0.7.0
google-apis-androidpublisher_v3 0.16.0
google-cloud-env 1.5.0
google-cloud-errors 1.2.0
google-cloud-core 1.6.0
google-apis-iamcredentials_v1 0.10.0
google-apis-storage_v1 0.11.0
digest-crc 0.6.4
google-cloud-storage 1.36.1
emoji_regex 3.2.3
aws-eventstream 1.2.0
aws-sigv4 1.4.0
aws-sdk-kms 1.55.0
aws-sdk-s3 1.113.0
CFPropertyList 3.0.5
excon 0.92.0
unf_ext 0.0.8.1
json 2.6.1
webrick 1.7.0
rake 13.0.6
aws-partitions 1.568.0
jmespath 1.6.1
aws-sdk-core 3.130.0
forwardable 1.2.0
logger 1.3.0
date 2.0.0
stringio 0.0.2
ipaddr 1.2.2
openssl 2.1.2
zlib 1.0.0
mutex_m 0.1.0
ostruct 0.1.0
strscan 1.0.0
io-console 0.4.7
fileutils 1.1.0
etc 1.0.1
libxml-ruby 3.2.1
psych 3.1.0
fastlane-plugin-firebase_app_distribution 0.3.3

generated on: 2022-03-28

[20:12:52]: Take notice that this output may contain sensitive information, or simply information that you don't want to make public. [20:12:52]: 🙄 Wow, that's a lot of markdown text... should fastlane put it into your clipboard, so you can easily paste it on GitHub? (y/n) y [20:12:56]: Successfully copied markdown into your clipboard 🎨 [20:12:56]: Open https://github.com/fastlane/fastlane/issues/new to submit a new issue ✅
@yamschikov-vs
Copy link

I have same issue. If call same xcodebuild command from log, all works fine

@moz134
Copy link
Author

moz134 commented Mar 29, 2022

Can you explain a little bit more, how are you calling xcodebuild?

@yamschikov-vs
Copy link

I'm only try call command from the fastlane build log.
set -o pipefail && xcodebuild -workspace <ProjectName>.xcworkspace -scheme <ShemeName> -destination 'generic/platform=iOS' -archivePath /Users/ios/Library/Developer/Xcode/Archives/2022-03-29/<ProjectName>\ 2022-03-29\ 09.44.23.xcarchive archive | tee /Users/ios/Library/Logs/gym/<ProjectName>.log | xcpretty

But preffer to use fastlane. Did you try to use previous fastlane version?

@moz134
Copy link
Author

moz134 commented Mar 29, 2022

okay, let me directly use xcodebuild command.
No i didn't try with previous fastlane version. i'll try and let you know.

@rares-lupascu
Copy link

same here :(

The following build commands failed:
        PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/wowzaaa/Library/Developer/Xcode/DerivedData/uHubs-blnerskrnxheerfjcwzjslxniczt/Build/Intermediates.noindex/ArchiveIntermediates/Dev/IntermediateBuildFilesPath/Pods.build/Development.Release-iphoneos/FBReactNativeSpec.build/Script-097CEF56F0CD5FFE4BF04151896369A2.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)
[16:44:19]: Exit status: 65

@rares-lupascu
Copy link

in my case it was a react-native issue react-native-community/upgrade-support#138

@maxckelly
Copy link

Has anyone found a solution to this? I've updated my mac and Xcode now gym is failing. Unsure what it could be.

@hkeithk
Copy link

hkeithk commented Apr 27, 2022

Seeing a similar issue here, was working a few days ago but has failed today without any changes

@maxckelly
Copy link

I had an exit code 65 looking over my logs I found I had a custom script that was copying a env file. For some reason that started causing a build error in the new xCode. I deleted that script by editing the scheme config.

Unsure this will be related to your issue but might be a cause for someone in the future.

@hkeithk
Copy link

hkeithk commented Apr 29, 2022

For me it was a combination of a custom script, downgrading from xcode 13.3.1 to 13.2.1 & downgrading ruby to 3.0.3 from 3.1.3, which was the last setup that worked for me.. Hope this helps someone else.

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@deathemperor
Copy link

I'm having the exactly same issue building with Github Actions. same as #20276

I'm able to build with my Mac (M1) just fine.

@Akkowicz
Copy link

For the people that have this issue:
Check the output file that's mentioned in your log.

If it contains
error: symbols referenced by indirect symbol table entries that can't be stripped

It's may be an issue with linker flags conflicting with symbol stripping, try removing -interposable, we've removed

					"-Xlinker",
					"-interposable",
					"-Xlinker",
					"-undefined",
					"-Xlinker",
					dynamic_lookup,

and it started working correctly.

@IrmantasMarozas
Copy link

Facing the same issue in CI for a month now and we can't figure out what's causing the error.

Command PhaseScriptExecution failed with a nonzero exit code

@Akkowicz
Copy link

It just means that command that was being run in PhaseScriptExecution wasn't successful, you have to check detailed logs from the execution. The location of the log is probably mentioned somewhere in the fastlane output.

@venxik
Copy link

venxik commented Aug 10, 2022

I had the exact same problem and finally found out that the cause of this error because i haven't put my .env file onto my root project. I had pre-action script to read the env file as i am using react-native-config for different schemes, that's why i'm getting error if i dont have the .env file. So my solution is to put base64 string of the env file to github secret and then copy & decode it in the github workflow. After that everything works like a charm. Maybe this can help someone :)

@AAlvarez90
Copy link

I just solved this issue by opening Xcode and found out that in the iMac (where I got the error) the project did not have In-App Purchases capabilities and the signing team was none, so I had to login into Apple to assign a team. For some reason, the new setup erased my previous configs..

@rodrigodmpa
Copy link

This solved my problem: https://stackoverflow.com/questions/73765469/signing-for-googlesignin-googlesignin-requires-a-development-team.

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@FanchenBao
Copy link

In my case, there was no error message in fastlane or xcode build's output when archive failed. If you encounter the same situation, this SO answer pointed to where the missing error message can be found.

@gabrielchaves7
Copy link

gabrielchaves7 commented Feb 10, 2023

I was having this issue on GitHub actions while trying to run fastlane with match to deploy iOS app to TestFlight, what fixed for me was disable_automatic_code_signing before calling match.

   disable_automatic_code_signing(
    team_id: "",
    profile_name: "",
    code_sign_identity: ''
  )

@sversov
Copy link

sversov commented Feb 17, 2023

Add

gym(
....
xcargs: "CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM="
}

Resolved the issue for me

@miibpa
Copy link

miibpa commented Mar 6, 2023

When using match + gym on Fastlane. Using update_code_signing_settings before match ins what did the trick, the resulting operations look like this:

update_code_signing_settings(
    use_automatic_signing: false,
    team_id: team_id,
    targets: [target],
    code_sign_identity: "*****",
    profile_name: "your_profile_name",
    path: PROJECT_PATH
  )

  match(
    username: options[:username],
    git_url: certificates_url,
    app_identifier: app_identifier,
    type: "appstore", 
    team_id: team_id
  )
  
  gym(
    project: PROJECT_PATH,
    export_method: "app-store",
    configuration: "Release", 
    scheme: scheme,
  )

@LoyaltyWu
Copy link

LoyaltyWu commented Mar 9, 2023

In my case, it has something to do with the provisioning files, certificates I chose to build. Some of the certificates is missing in one of my machines, and it lead to this error. And there's no error message related to certificates or provisioning files in Fastlane console. The errors show when I archive on Xcode.

@hajisu01
Copy link

In my case, it has something to do with the provisioning files, certificates I chose to build. Some of the certificates is missing in one of my machines, and it lead to this error. And there's no error message related to certificates or provisioning files in Fastlane console. The errors show when I archive on Xcode.

@LoyaltyWu could you explain last sentence in detail? The errors show when I archive on Xcode.
how can I get error from xcode?

@leonidlist
Copy link

Same here, when running locally everything's fine, but on GitHub Actions it fails with exit status 65

@marcshilling
Copy link

For me this was an issue with provisioning profiles. The app_identifier I was passing to match was for my production app and building my "beta" app (different bundle ID) was failing with exit code 65 because it was trying to use the wrong profile. It was running fine locally for me because I have both profiles installed on my machine, but on CI it was failing because it installs the profiles fresh.

Frustrating that a more helpful error message isn't spit out, but hope this helps someone else out. Ultimately I noticed this by looking at the output of match.

@WuKong94
Copy link

I also encountered a similar problem. After reading the log, I found more detailed reasons, which were caused by certificate conflict

@x7Michi10x
Copy link

I received this issue after upgrading to xcode 14.
First answer solved it for me:
https://stackoverflow.com/questions/74275390/fastlane-with-xcode-14-archive-failed

@matteolucinip
Copy link

I received this issue after upgrading to xcode 14. First answer solved it for me: https://stackoverflow.com/questions/74275390/fastlane-with-xcode-14-archive-failed

This fixed my error as well, thanks!

@kNoAPP
Copy link

kNoAPP commented Jul 1, 2023

Had this problem, struggled for days to solve it. Putting my solution here too for posterity:

I'm using Flutter, but I think this applies globally. If you introduce a new iOS build target into your app, and that target required you to add a new identifier, your fastlane instance probably needs a 2nd mobile provision referenced.

For example, my original project referenced com.company.project, but then I added a target that used com.company.project.Broadcast-Extension. My fastlane builds started failing with Exit Status 65, but XCode was still able to build it.

Check https://developer.apple.com/account/resources/identifiers/list to see if a new identifier got added to your project. For me, I had created a Broadcast Extension to enable screen-share on LiveKit.io. As part of the process, I had to create a new Upload Broadcast Extension target in my XCode project. I did so without updating fastlane with a second mobile provision, and my builds began failing.

The solution was to create a second provisioning profile for my broadcast extension at https://developer.apple.com/account/resources/profiles/list with the new identifier. Then, install both my provisioning profiles with:

install_provisioning_profile(path: <insert_path_to_mobile_provision>)

Finally, create an ExportOptions.plist file based off this template which specifies what mobile provisioning profile should be used for each target. Ensure each name/identifier pair EXACTLY matches your provisioning profile as seen in at https://developer.apple.com/account/resources/profiles/list and identifier as seen in https://developer.apple.com/account/resources/identifiers/list. Reference the ExportOptions.plist file by passing its path to

build_app(
      [...]
      export_options: <Path to ExportOptions.plist>,
    )

For CI/CD, I recommend using https://github.com/yukiarrr/ios-build-action which massively simplifies the iOS build process headache.

I hope this helps fellow engineers!

@Remas-Safi
Copy link

Remas-Safi commented Jul 31, 2023

My can similar to kNoAPP

This might help someone as it helped me, where I'm running this as Github Action, and archiving keep fail with no clear reason, and I can't access the logs file.
Archiving for sure can fail for different reasons, but the fastlane logs weren't clear, which it suggests that you should specify the Xcode version, and I did by using xcodes option on fastlane but it still didn't work.

So I needed to see the log files that are being generated by Fastlane where it exists in (as it is clear in Fastlane logs) /Users/runner/Library/Logs/gym/Runner-dev.log... which for sure has more details, but this step should be after the fastlane step and need to run even if fastlane failed: to do so, you just use these simple two lines:

      - run: cat /Users/runner/Library/Logs/gym/Runner-dev.log
        if: failure()

or to always run this

      - run: cat /Users/runner/Library/Logs/gym/Runner-dev.log
        if: always()

And turns out my problem with the provisioning profile, and as you know Fastlane match creats one but I am using automatic signing and not the one created by match, I've found the solution [here] (#18182 (comment)) where you just have to uncheck the auto signing and select the match provisioning profile in xcode and on all extensions (if there is one, for me its OneSignal extension) and fixed by issue, hope this helps someone out there

@Dante1349
Copy link

Dante1349 commented Nov 17, 2023

I only have this problem when i run my fastlane command with a runner, when i use the same environment and execute the command on the host directly it works. It worked with the same runner before the xcodee 14 update. Does anyone have a clue?

@Dante1349
Copy link

I only have this problem when i run my fastlane command with a runner, when i use the same environment and execute the command on the host directly it works. It worked with the same runner before the xcodee 14 update. Does anyone have a clue?

i fixed it by changing the environment, i guess it was export LANG=en_US.UTF-8 but I'm not sure

@masewo
Copy link

masewo commented May 15, 2024

Flutter dev here. I had to login again in XCode with my Apple account after a year or so...

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