Search code examples
iosfastlanefastlane-matchfastlane-gym

Exporting iOS archive hangs forever (fastlane)


My Apple certificate expired recently so I had to refresh it along with provisioning profile. I decided to get use of Fastlane and Match (with GitHub storage).

My Fastfile looks as follows:

fastlane_version '2.216.0'

platform :ios do
    desc 'Fetch certificates and provisioning profiles'
    lane :certificates do
      match(app_identifier: 'com.quietmobile', type: 'appstore', readonly: true)
    end

    desc 'Build the iOS application.'
    lane :build do
        certificates
        gym
    end
 end

everything goes well until archive exporting begins. This is the tail of gym output:


INFO [2023-09-22 11:50:55.22]: ▸ Archive Succeeded
DEBUG [2023-09-22 11:50:55.26]: Stored the archive in: /Users/apple/Library/Developer/Xcode/Archives/2023-09-22/Quiet 2023-09-22 11.42.18.xcarchive
WARN [2023-09-22 11:50:55.26]: Generated plist file with the following values:
INFO [2023-09-22 11:50:55.26]: ▸ -----------------------------------------
INFO [2023-09-22 11:50:55.26]: ▸ {
INFO [2023-09-22 11:50:55.26]: ▸   "provisioningProfiles": {
INFO [2023-09-22 11:50:55.26]: ▸     "com.quietmobile": "match AppStore com.quietmobile"
INFO [2023-09-22 11:50:55.26]: ▸   },
INFO [2023-09-22 11:50:55.26]: ▸   "method": "app-store",
INFO [2023-09-22 11:50:55.26]: ▸   "signingStyle": "manual"
INFO [2023-09-22 11:50:55.26]: ▸ }
INFO [2023-09-22 11:50:55.26]: ▸ -----------------------------------------
INFO [2023-09-22 11:50:55.26]: This results in the following plist file:
INFO [2023-09-22 11:50:55.26]: ▸ -----------------------------------------
INFO [2023-09-22 11:50:55.27]: ▸ <?xml version="1.0" encoding="UTF-8"?>
INFO [2023-09-22 11:50:55.27]: ▸ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
INFO [2023-09-22 11:50:55.27]: ▸ <plist version="1.0">
INFO [2023-09-22 11:50:55.27]: ▸ <dict>
INFO [2023-09-22 11:50:55.27]: ▸  <key>method</key>
INFO [2023-09-22 11:50:55.27]: ▸  <string>app-store</string>
INFO [2023-09-22 11:50:55.27]: ▸  <key>provisioningProfiles</key>
INFO [2023-09-22 11:50:55.27]: ▸  <dict>
INFO [2023-09-22 11:50:55.27]: ▸          <key>com.quietmobile</key>
INFO [2023-09-22 11:50:55.27]: ▸          <string>match AppStore com.quietmobile</string>
INFO [2023-09-22 11:50:55.27]: ▸  </dict>
INFO [2023-09-22 11:50:55.27]: ▸  <key>signingStyle</key>
INFO [2023-09-22 11:50:55.27]: ▸  <string>manual</string>
INFO [2023-09-22 11:50:55.27]: ▸ </dict>
INFO [2023-09-22 11:50:55.27]: ▸ </plist>
INFO [2023-09-22 11:50:55.27]: ▸ -----------------------------------------
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                                         Generated Package Command                                                                                         |
+------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| Option                                                                                                           | Value                                                                                  |
+------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| /usr/bin/xcrun                                                                                                   |                                                                                        |
| /usr/local/Cellar/fastlane/2.216.0/libexec/gems/fastlane-2.216.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh  |                                                                                        |
| -exportArchive                                                                                                   |                                                                                        |
| -exportOptionsPlist                                                                                              | /var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/gym_config20230922-29144-scv0bk.plist |
| -archivePath /Users/apple/Library/Developer/Xcode/Archives/2023-09-22/Quiet\ 2023-09-22\ 11.42.18.xcarchive      |                                                                                        |
| -exportPath                                                                                                      | /var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/gym_output20230922-29144-aejs4j       |
+------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
INFO [2023-09-22 11:50:55.27]: $ /usr/bin/xcrun /usr/local/Cellar/fastlane/2.216.0/libexec/gems/fastlane-2.216.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/gym_config20230922-29144-scv0bk.plist' -archivePath /Users/apple/Library/Developer/Xcode/Archives/2023-09-22/Quiet\ 2023-09-22\ 11.42.18.xcarchive -exportPath '/var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/gym_output20230922-29144-aejs4j' 
INFO [2023-09-22 11:50:55.33]: ▸ rbenv detected, removing env variables
INFO [2023-09-22 11:50:55.36]: ▸ rbenv: shell integration not enabled. Run `rbenv init' for instructions.
INFO [2023-09-22 11:50:55.36]: ▸ + xcodebuild -exportArchive -exportOptionsPlist /var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/gym_config20230922-29144-scv0bk.plist -archivePath '/Users/apple/Library/Developer/Xcode/Archives/2023-09-22/Quiet 2023-09-22 11.42.18.xcarchive' -exportPath /var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/gym_output20230922-29144-aejs4j
INFO [2023-09-22 11:50:56.90]: ▸ 2023-09-22 11:50:56.904 xcodebuild[31196:263612] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/b6/dx33qf4s6s910wblq_5n2w2c0000gn/T/Quiet_2023-09-22_11-50-56.902.xcdistributionlogs".

I was waiting for 3 hours but it didn't go any further. I tried to run the exporting command manually. The result was the same BUT if prefixed with sudo it says:

error: exportArchive: No "iOS App Store" profiles for team 'Zbay LLC' matching 'match AppStore com.quietmobile' are installed.

I have my certificate (the one generated by match) installed in my keychain. Release signing configuration in Xcode is set like that:

enter image description here

I think neither Fastlane nor Match are the important factors here and the problem lays within signing configuration itself, nevertheless I mention it as it's currently my exact setup.

=========

Fastlane 2.216.0

Xcode 14.3.1

macOS Ventura 13.4.1


Solution

  • I got to the bottom of the problem by using Xcodes' GUI to export an archive. It shows different output than terminal:

    enter image description here

    This was the hanging step so I simply excluded symbols and it started to work.