fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.71k stars 5.72k forks source link

Gym Not Working on Github Actions #21201

Open Mcrich23 opened 1 year ago

Mcrich23 commented 1 year ago

New Issue Checklist

Issue Description

Hi All, I am trying to deploy fastlane beta to GitHub Actions and am massively struggling. Here is my fastfile:

# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
update_fastlane

default_platform(:ios)

platform :ios do
  lane :refreshAllProfiles do
    if ENV['CI']
      setup_ci
      sh("git clone https://$GITHUB_TOKEN:$GITHUB_TOKEN@github.com/recosia/recosiaioscerts.git /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230415-2692-7463bi")
    end
    app_store_connect_api_key(
      key_id: 'V6263THD37',
      issuer_id: '25935d76-7d64-4a2e-8232-657bdcbcc2a2',
      key_filepath: './fastlane/AuthKey_V6263THD37.p8'
    )
    #Staging profiles
    match(app_identifier: 'com.recosia.staging', type: 'appstore')
    match(app_identifier: 'com.recosia.staging', type: 'development')
    match(app_identifier: 'com.recosia.staging.notification-service', type: 'appstore')
    match(app_identifier: 'com.recosia.staging.notification-service', type: 'development')

    #Production Profiles
    match(app_identifier: 'com.recosia.production', type: 'appstore')
    match(app_identifier: 'com.recosia.production', type: 'development')
    match(app_identifier: 'com.recosia.production.notification-service', type: 'appstore')
    match(app_identifier: 'com.recosia.production.notification-service', type: 'development')
  end
  desc 'Push a new beta build to TestFlight'
  lane :beta do
    app_store_connect_api_key(
      key_id: 'V6263THD37',
      issuer_id: '25935d76-7d64-4a2e-8232-657bdcbcc2a2',
      key_filepath: './fastlane/AuthKey_V6263THD37.p8'
    )
    if ENV['CI']
      setup_ci
      sh("git clone https://$GITHUB_TOKEN:$GITHUB_TOKEN@github.com/recosia/recosiaioscerts.git /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230415-2692-7463bi")
    end
    match(app_identifier: 'com.recosia.staging', type: 'appstore')
    match(app_identifier: 'com.recosia.staging.notification-service', type: 'appstore')
    # precheck
    getVersion = get_version_number(xcodeproj: 'RecosiaIOS.xcodeproj', target: 'RecosiaIOS')
    latestBuildNumber = latest_testflight_build_number(version: getVersion, initial_build_number: 0)
    increment_build_number(build_number: latestBuildNumber + 1, xcodeproj: 'RecosiaIOS.xcodeproj')
    getBuild = get_build_number(xcodeproj: 'RecosiaIOS.xcodeproj')

    # Build the app
    sh('rm -rf ~/Library/Developer/Xcode/DerivedData')
    build_app(
      scheme: "Development",
      output_directory: "./Builds/#{getVersion}/#{getBuild}"
    )

    upload_to_testflight
    # getScreenshots
  rescue Exception => e
    getVersion = get_version_number(xcodeproj: 'RecosiaIOS.xcodeproj', target: 'RecosiaIOS')
    getBuild = get_build_number(xcodeproj: 'RecosiaIOS.xcodeproj')
    notification(subtitle: 'Recosia Beta Upload',
                 message: "Fastlane has encountered an error while uploading beta to TestFlight: #{e}")
    discord_notifier(
      webhook_url: 'https://discord.com/api/webhooks/1096637220389138542/dc12G5blOXMCSit2FmHA3jo95b61lVpDZAH9ic5qIPiqcDcmmSmr-ap_ymmk_TpY9FOW',
      title: 'Recosia Beta Upload',
      description: "Fastlane has encountered an error while uploading beta to TestFlight: #{e}",
      fields: [
        {
          name: 'Version',
          value: "#{getVersion}",
          inline: false
        },
        {
          name: 'Build',
          value: "#{getBuild}",
          inline: false
        },
        {
          name: 'Link to TestFlight',
          value: 'https://appstoreconnect.apple.com/apps/6447685447/testflight/ios',
          inline: false
        },
        {
          name: 'Link to Github Actions Page',
          value: ENV["GITHUB_ACTION_URL"],
          inline: false
        }
      ]
    )
  else
    uploadToCrashlytics
    notification(subtitle: 'Recosia Beta Upload', message: 'Fastlane has finished uploading Recosia to TestFlight',
                 open: 'https://appstoreconnect.apple.com/apps/6447685447/testflight/ios')
    discord_notifier(
      webhook_url: 'https://discord.com/api/webhooks/1096637220389138542/dc12G5blOXMCSit2FmHA3jo95b61lVpDZAH9ic5qIPiqcDcmmSmr-ap_ymmk_TpY9FOW',
      title: 'Recosia Beta Upload',
      description: 'Fastlane has finished uploading Recosia to TestFlight',
      fields: [
        {
          name: 'Version',
          value: "#{getVersion}",
          inline: false
        },
        {
          name: 'Build',
          value: "#{getBuild}",
          inline: false
        },
        {
          name: 'Link to TestFlight',
          value: 'https://appstoreconnect.apple.com/apps/6447685447/testflight/ios',
          inline: false
        },
        {
          name: 'Link to Github Actions Page',
          value: ENV["GITHUB_ACTION_URL"],
          inline: false
        }
      ]
    )
  end
  lane :production do
    app_store_connect_api_key(
      key_id: 'V6263THD37',
      issuer_id: '25935d76-7d64-4a2e-8232-657bdcbcc2a2',
    key_filepath: './fastlane/AuthKey_V6263THD37.p8'
    )
    if ENV['CI']
      setup_ci
      sh("git clone https://$GITHUB_TOKEN:$GITHUB_TOKEN@github.com/recosia/recosiaioscerts.git /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230415-2692-7463bi")
    end
    match(app_identifier: 'com.recosia.staging', type: 'appstore')
    match(app_identifier: 'com.recosia.staging.notification-service', type: 'appstore')
  end
  lane :getScreenshots do
    Dir.chdir('..') do
      # sh("ls")
      sh("sh './Promo/Remove Screenshots.sh'")
    end
    capture_screenshots(headless: false, clear_previous_screenshots: false, output_directory: './Promo/Light Mode',
                        dark_mode: false)
    capture_screenshots(headless: false, clear_previous_screenshots: false, output_directory: './Promo/Dark Mode',
                        dark_mode: true)
    Dir.chdir('..') do
      notification(subtitle: 'Finished Taking Screenshots', message: 'Ready to mockup...',
                   open: 'file:///~/Xcode/RecosiaIOS/Promo/AppMockUp Studio.webarchive')
      sh("sh './Promo/Convert Screenshots.sh'")
      sh("sh './Promo/Remove png Screenshots.sh'")
    end
    # frame_screenshots(path: "./Promo")
  end
  lane :uploadBetaToCrashlytics do
    getVersion = get_version_number(xcodeproj: 'RecosiaIOS.xcodeproj', target: 'RecosiaIOS')
    getBuild = get_build_number(xcodeproj: 'RecosiaIOS.xcodeproj')
    # download_dsyms(version: "latest", output_directory: "./Builds/#{getVersion}/#{getBuild}")
    Dir.chdir('..') do
      sh("./fastlane/Crashlytics/upload-symbols -gsp './RecosiaIOS/GoogleService-Info-Beta.plist' -p ios ./Builds/#{getVersion}/#{getBuild}/RecosiaIOS.app.dSYM.zip")
    end
  rescue Exception => e
    notification(subtitle: 'Firebase Crashlytics',
                 message: "Fastlane encountered an error while uploading the latest beta build to Firebase Crashlytics: #{e}")
    discord_notifier(
      webhook_url: 'https://discord.com/api/webhooks/1096637220389138542/dc12G5blOXMCSit2FmHA3jo95b61lVpDZAH9ic5qIPiqcDcmmSmr-ap_ymmk_TpY9FOW',
      title: 'Firebase Crashlytics',
      description: "Fastlane encountered an error while uploading the latest beta build to Firebase Crashlytics: #{e}",
      fields: [
        {
          name: 'Version',
          value: "#{getVersion}",
          inline: false
        },
        {
          name: 'Build',
          value: "#{getBuild}",
          inline: false
        },
        {
          name: 'Link to Firebase Crashlytics',
          value: 'https://console.firebase.google.com/project/recosia-dev/crashlytics',
          inline: false
        },
        {
          name: 'Link to Github Actions Page',
          value: ENV["GITHUB_ACTION_URL"],
          inline: false
        }
      ]
    )
  else
    notification(subtitle: 'Firebase Crashlytics',
                 message: 'Fastlane finished uploading the latest production build to Firebase Crashlytics')
    discord_notifier(
      webhook_url: 'https://discord.com/api/webhooks/1096637220389138542/dc12G5blOXMCSit2FmHA3jo95b61lVpDZAH9ic5qIPiqcDcmmSmr-ap_ymmk_TpY9FOW',
      title: 'Firebase Crashlytics',
      description: 'Fastlane finished uploading the latest production build to Firebase Crashlytics',
      fields: [
        {
          name: 'Version',
          value: "#{getVersion}",
          inline: false
        },
        {
          name: 'Build',
          value: "#{getBuild}",
          inline: false
        },
        {
          name: 'Link to Firebase Crashlytics',
          value: 'https://console.firebase.google.com/project/recosia-dev/crashlytics',
          inline: false
        },
        {
          name: 'Link to Github Actions Page',
          value: ENV["GITHUB_ACTION_URL"],
          inline: false
        }
      ]
    )
  end
  lane :uploadProductionToCrashlytics do
    getVersion = get_version_number(xcodeproj: 'RecosiaIOS.xcodeproj', target: 'Production')
    getBuild = get_build_number(xcodeproj: 'RecosiaIOS.xcodeproj')
    # download_dsyms(version: "latest", output_directory: "./Builds/#{getVersion}/#{getBuild}")
    Dir.chdir('..') do
      sh("./fastlane/Crashlytics/upload-symbols -gsp './RecosiaIOS/GoogleService-Info.plist' -p ios ./Builds/#{getVersion}/#{getBuild}/RecosiaIOS.app.dSYM.zip")
    end
  rescue Exception => e
    notification(subtitle: 'Firebase Crashlytics',
                 message: "An error occured while uploading the latest production build to Firabse Crashlytics: #{e}")
    discord_notifier(
      webhook_url: 'https://discord.com/api/webhooks/1096637220389138542/dc12G5blOXMCSit2FmHA3jo95b61lVpDZAH9ic5qIPiqcDcmmSmr-ap_ymmk_TpY9FOW',
      title: 'Firebase Crashlytics',
      description: "Fastlane encountered an error while uploading the latest beta build to Firebase Crashlytics: #{e}",
      fields: [
        {
          name: 'Version',
          value: "#{getVersion}",
          inline: false
        },
        {
          name: 'Build',
          value: "#{getBuild}",
          inline: false
        },
        {
          name: 'Link to Firebase Crashlytics',
          value: 'https://console.firebase.google.com/project/recosia-prod/crashlytics',
          inline: false
        },
        {
          name: 'Link to Github Actions Page',
          value: ENV["GITHUB_ACTION_URL"],
          inline: false
        }
      ]
    )
  else
    notification(subtitle: 'Uploaded to Firebase Crashlytics',
                 message: 'Fastlane finished uploading the latest production build to Firebase Crashlytics')
    discord_notifier(
      webhook_url: 'https://discord.com/api/webhooks/1096637220389138542/dc12G5blOXMCSit2FmHA3jo95b61lVpDZAH9ic5qIPiqcDcmmSmr-ap_ymmk_TpY9FOW',
      title: 'Firebase Crashlytics',
      description: 'Fastlane finished uploading the latest production build to Firebase Crashlytics',
      fields: [
        {
          name: 'Version',
          value: "#{getVersion}",
          inline: false
        },
        {
          name: 'Build',
          value: "#{getBuild}",
          inline: false
        },
        {
          name: 'Link to Firebase Crashlytics',
          value: 'https://console.firebase.google.com/project/recosia-prod/crashlytics',
          inline: false
        },
        {
          name: 'Link to Github Actions Page',
          value: ENV["GITHUB_ACTION_URL"],
          inline: false
        }
      ]
    )
  end
end
Command executed
name: Upload Beta To Testflight
on:
  workflow_dispatch:
  push:
    branches:
      - 'Pre-Release-Beta'
jobs:
  build:
    runs-on: macos-latest
    steps:
      - uses: tibdex/github-app-token@v1
        id: get_installation_token
        with: 
          app_id: 314931
          # installation_id not needed IF the app is installed on this current repo
          installation_id: 36159662
          private_key: ${{ secrets.PRIVATE_KEY }}
      - uses: actions/checkout@v2
      - run: fastlane beta
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
          GITHUB_ACTION_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
          FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: '120'
Complete output when running fastlane, including the stack trace and command used
[23:01:44]: fastlane detected a Gemfile in the current directory
[23:01:44]: However, it seems like you didn't use `bundle exec`
[23:01:44]: To launch fastlane faster, please use
[23:01:44]: 
[23:01:44]: $ bundle exec fastlane beta
[23:01:44]: 
[23:01:44]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
Your Gemfile lists the gem fastlane-plugin-discord_notifier (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
[23:01:47]: Installing Ruby gem 'fastlane-plugin-discord_notifier'...
[23:01:49]: Successfully installed 'fastlane-plugin-discord_notifier'
[23:01:50]: Plugin 'DiscordNotifier' overwrites already loaded action 'discord_notifier'
[23:01:50]: Plugin 'DiscordNotifier' overwrites already loaded action 'discord_notifier'
+----------------------------------+---------+------------------+
|                         Used plugins                          |
+----------------------------------+---------+------------------+
| Plugin                           | Version | Action           |
+----------------------------------+---------+------------------+
| fastlane-plugin-discord_notifier | 0.1.7   | discord_notifier |
+----------------------------------+---------+------------------+

[23:01:51]: Sending anonymous analytics information
[23:01:51]: Learn more at https://docs.fastlane.tools/#metrics
[23:01:51]: No personal or sensitive data is sent.
[23:01:51]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[23:01:51]: -----------------------------
[23:01:51]: --- Step: update_fastlane ---
[23:01:51]: -----------------------------
[23:01:51]: Looking for updates for fastlane...
[23:01:55]: Nothing to update ✅
[23:01:55]: ------------------------------
[23:01:55]: --- Step: default_platform ---
[23:01:55]: ------------------------------
[23:01:55]: Driving the lane 'ios beta' 🚀
[23:01:55]: ---------------------------------------
[23:01:55]: --- Step: app_store_connect_api_key ---
[23:01:55]: ---------------------------------------
[23:01:55]: ----------------------
[23:01:55]: --- Step: setup_ci ---
[23:01:55]: ----------------------
[23:01:55]: Creating temporary keychain: "fastlane_tmp_keychain".
[23:01:55]: $ security list-keychains -d user
[23:01:55]: ▸ "/Users/runner/Library/Keychains/fastlane_tmp_keychain-db"
[23:01:55]: Found keychain '/Users/runner/Library/Keychains/fastlane_tmp_keychain-db' in list-keychains, adding to search list skipped
[23:01:55]: Enabling match readonly mode.
[23:01:55]: --------------------------------------------------------------------
[23:01:55]: Step: git clone ***github.com/recosia/recosiaioscerts.git /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230415-2692-7463bi
[23:01:55]: --------------------------------------------------------------------
[23:01:55]: $ git clone ***github.com/recosia/recosiaioscerts.git /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230415-2692-7463bi
[23:01:55]: ▸ Cloning into '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230415-2692-7463bi'...
[23:01:56]: --------------------------------
[23:01:56]: --- Step: get_version_number ---
[23:01:56]: --------------------------------
[23:01:56]: --------------------------------------------
[23:01:56]: --- Step: latest_testflight_build_number ---
[23:01:56]: --------------------------------------------
[23:01:56]: Using existing authorization token for App Store Connect API
[23:01:57]: Fetching the latest build number for version 1.0
[23:01:57]: Latest upload for version 1.0 on ios platform is build: 5
[23:01:57]: ------------------------------------
[23:01:57]: --- Step: increment_build_number ---
[23:01:57]: ------------------------------------
Current version of project RecosiaIOS is: 
    6

/Users/runner/work/Recosia-IOS/Recosia-IOS
[23:02:02]: $ cd /Users/runner/work/Recosia-IOS/Recosia-IOS && agvtool new-version -all 6 && cd -
[23:02:03]: ▸ Setting version of project RecosiaIOS to:
[23:02:03]: ▸ 6.
[23:02:03]: ▸ Also setting CFBundleVersion key (assuming it exists)
[23:02:03]: ▸ Updating CFBundleVersion in Info.plist(s)...
[23:02:03]: ▸ Updated CFBundleVersion in "RecosiaIOS.xcodeproj/../Notification Service/Info.plist" to 6
[23:02:03]: ▸ Updated CFBundleVersion in "RecosiaIOS.xcodeproj/../RecosiaIOS/Info.plist" to 6
[23:02:03]: ▸ Cannot find "RecosiaIOS.xcodeproj/../YES"
[23:02:03]: ▸ /Users/runner/work/Recosia-IOS/Recosia-IOS
[23:02:03]: ------------------------------
[23:02:03]: --- Step: get_build_number ---
[23:02:03]: ------------------------------
[23:02:03]: $ cd /Users/runner/work/Recosia-IOS/Recosia-IOS && agvtool what-version -terse
[23:02:04]: ▸ 6
[23:02:04]: ----------------------------------------------------------
[23:02:04]: --- Step: rm -rf ~/Library/Developer/Xcode/DerivedData ---
[23:02:04]: ----------------------------------------------------------
[23:02:04]: $ rm -rf ~/Library/Developer/Xcode/DerivedData
[23:02:04]: -----------------------
[23:02:04]: --- Step: build_app ---
[23:02:04]: -----------------------
[23:02:04]: Resolving Swift Package Manager dependencies...
[23:02:04]: $ xcodebuild -resolvePackageDependencies -scheme Development -project ./RecosiaIOS.xcodeproj
[23:02:05]: ▸ Command line invocation:
[23:02:05]: ▸     /Applications/Xcode_14.2.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -scheme Development -project ./RecosiaIOS.xcodeproj
[23:02:05]: ▸ User defaults from command line:
[23:02:05]: ▸     IDEPackageSupportUseBuiltinSCM = YES
[23:02:11]: ▸ Resolve Package Graph
[23:02:11]: ▸ Fetching from https://github.com/SDWebImage/SDWebImageSwiftUI.git
[23:02:15]: ▸ Fetching from https://github.com/SDWebImage/SDWebImage.git
[23:02:15]: ▸ Fetching from https://github.com/Alamofire/Alamofire
[23:02:16]: ▸ Fetching from https://github.com/google/GoogleUtilities.git
[23:02:16]: ▸ Fetching from https://github.com/google/promises.git
[23:02:16]: ▸ Fetching from https://github.com/apple/swift-protobuf.git
[23:02:23]: ▸ Fetching from https://github.com/firebase/nanopb.git
[23:02:23]: ▸ Fetching from https://github.com/google/GoogleAppMeasurement.git
[23:02:23]: ▸ Fetching from https://github.com/firebase/boringssl-SwiftPM.git
[23:02:23]: ▸ Fetching from https://github.com/grpc/grpc-ios.git
[23:02:31]: ▸ Fetching from https://github.com/omaralbeik/Drops.git
[23:02:31]: ▸ Fetching from https://github.com/firebase/firebase-ios-sdk.git
[23:02:40]: ▸ Fetching from https://github.com/google/GoogleDataTransport.git
[23:02:40]: ▸ Fetching from https://github.com/firebase/leveldb.git
[23:02:40]: ▸ Fetching from https://github.com/google/gtm-session-fetcher.git
[23:02:40]: ▸ Fetching from https://github.com/firebase/abseil-cpp-SwiftPM.git
[23:03:19]: ▸ Cloning local copy of package ‘GoogleDataTransport’
[23:03:19]: ▸ Checking out 9.2.2 of package ‘GoogleDataTransport’
[23:03:19]: ▸ Cloning local copy of package ‘swift-protobuf’
[23:03:19]: ▸ Checking out 1.21.0 of package ‘swift-protobuf’
[23:03:20]: ▸ Cloning local copy of package ‘abseil-cpp-SwiftPM’
[23:03:20]: ▸ Checking out 0.20220203.2 of package ‘abseil-cpp-SwiftPM’
[23:03:21]: ▸ Cloning local copy of package ‘nanopb��
[23:03:21]: ▸ Checking out 2.30909.0 of package ‘nanopb’
[23:03:22]: ▸ Cloning local copy of package ‘grpc-ios’
[23:03:22]: ▸ Checking out 1.44.3-grpc of package ‘grpc-ios’
[23:03:50]: ▸ Cloning local copy of package ‘GoogleUtilities’
[23:03:50]: ▸ Checking out 7.11.1 of package ‘GoogleUtilities’
[23:03:50]: ▸ Cloning local copy of package ‘GoogleAppMeasurement’
[23:03:50]: ▸ Checking out 9.6.0 of package ‘GoogleAppMeasurement’
[23:03:50]: ▸ Cloning local copy of package ‘firebase-ios-sdk’
[23:03:51]: ▸ Checking out 9.6.0 of package ‘firebase-ios-sdk’
[23:03:55]: ▸ Cloning local copy of package ‘SDWebImage’
[23:03:55]: ▸ Checking out 5.15.5 of package ‘SDWebImage’
[23:03:55]: ▸ Cloning local copy of package ‘gtm-session-fetcher’
[23:03:56]: ▸ Checking out 2.3.0 of package ‘gtm-session-fetcher’
[23:03:56]: ▸ Cloning local copy of package ‘SDWebImageSwiftUI’
[23:03:56]: ▸ Checking out 2.2.2 of package ‘SDWebImageSwiftUI’
[23:03:56]: ▸ Cloning local copy of package ‘Alamofire’
[23:03:56]: ▸ Checking out 5.6.4 of package ‘Alamofire’
[23:03:57]: ▸ Cloning local copy of package ‘boringssl-SwiftPM’
[23:03:57]: ▸ Checking out 0.9.1 of package ‘boringssl-SwiftPM’
[23:04:03]: ▸ Cloning local copy of package ‘Drops’
[23:04:04]: ▸ Checking out 1.6.1 of package ‘Drops’
[23:04:04]: ▸ Cloning local copy of package ‘promises’
[23:04:05]: ▸ Checking out 2.2.0 of package ‘promises’
[23:04:05]: ▸ Cloning local copy of package ‘leveldb’
[23:04:05]: ▸ Checking out 1.22.2 of package ‘leveldb’
[23:04:56]: ▸ Resolved source packages:
[23:04:56]: ▸   gRPC: https://github.com/grpc/grpc-ios.git @ 1.44.3-grpc
[23:04:56]: ▸   SDWebImage: https://github.com/SDWebImage/SDWebImage.git @ 5.15.5
[23:04:56]: ▸   SwiftProtobuf: https://github.com/apple/swift-protobuf.git @ 1.21.0
[23:04:56]: ▸   SDWebImageSwiftUI: https://github.com/SDWebImage/SDWebImageSwiftUI.git @ 2.2.2
[23:04:56]: ▸   GoogleUtilities: https://github.com/google/GoogleUtilities.git @ 7.11.1
[23:04:56]: ▸   Drops: https://github.com/omaralbeik/Drops.git @ 1.6.1
[23:04:56]: ▸   GoogleAppMeasurement: https://github.com/google/GoogleAppMeasurement.git @ 9.6.0
[23:04:56]: ▸   Promises: https://github.com/google/promises.git @ 2.2.0
[23:04:56]: ▸   BoringSSL-GRPC: https://github.com/firebase/boringssl-SwiftPM.git @ 0.9.1
[23:04:56]: ▸   Firebase: https://github.com/firebase/firebase-ios-sdk.git @ 9.6.0
[23:04:56]: ▸   nanopb: https://github.com/firebase/nanopb.git @ 2.30909.0
[23:04:56]: ▸   GTMSessionFetcher: https://github.com/google/gtm-session-fetcher.git @ 2.3.0
[23:04:56]: ▸   GoogleDataTransport: https://github.com/google/GoogleDataTransport.git @ 9.2.2
[23:04:56]: ▸   leveldb: https://github.com/firebase/leveldb.git @ 1.22.2
[23:04:56]: ▸   Alamofire: https://github.com/Alamofire/Alamofire @ 5.6.4
[23:04:56]: ▸   abseil: https://github.com/firebase/abseil-cpp-SwiftPM.git @ 0.20220203.2
[23:04:56]: ▸ --- xcodebuild: WARNING: Using the first of multiple matching destinations:
[23:04:56]: ▸ { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[23:04:56]: ▸ { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[23:04:56]: ▸ { platform:iOS Simulator, id:2DDB1AC0-F8C8-4286-B863-619964C2FC5B, OS:16.2, name:iPhone 8 }
[23:04:56]: ▸ { platform:iOS Simulator, id:0B620841-6614-48CC-A205-E5E09EB53653, OS:16.2, name:iPhone 8 Plus }
[23:04:56]: ▸ { platform:iOS Simulator, id:A2E7F989-640B-447D-86F6-F8BB40E5ED34, OS:16.2, name:iPhone 11 }
[23:04:56]: ▸ { platform:iOS Simulator, id:105DDFE9-15CD-4662-984B-B06D28D29181, OS:16.2, name:iPhone 11 Pro }
[23:04:56]: ▸ { platform:iOS Simulator, id:2B9A63CF-8CAA-4595-B6D0-54EABC716032, OS:16.2, name:iPhone 11 Pro Max }
[23:04:56]: ▸ { platform:iOS Simulator, id:066A2CEE-78AC-461F-917D-0870C08AA2C1, OS:16.2, name:iPhone 12 }
[23:04:56]: ▸ { platform:iOS Simulator, id:C9EDEB9E-9F3C-40A0-AFFB-BDA82D2F92ED, OS:16.2, name:iPhone 12 Pro }
[23:04:56]: ▸ { platform:iOS Simulator, id:E4F654B1-E647-40A6-A886-5D451714A1AC, OS:16.2, name:iPhone 12 Pro Max }
[23:04:56]: ▸ { platform:iOS Simulator, id:3D262786-0008-4204-871D-561465F42ADF, OS:16.2, name:iPhone 12 mini }
[23:04:56]: ▸ { platform:iOS Simulator, id:8AC6E1D1-47D6-4A65-9706-2F8125E6987B, OS:16.2, name:iPhone 13 }
[23:04:56]: ▸ { platform:iOS Simulator, id:CEAC2FC3-F123-47F2-9402-44F7C80C3605, OS:16.2, name:iPhone 13 Pro }
[23:04:56]: ▸ { platform:iOS Simulator, id:82A937A7-5E83-426D-95AC-B4E0CE29B3F8, OS:16.2, name:iPhone 13 Pro Max }
[23:04:56]: ▸ { platform:iOS Simulator, id:95A7220A-9CA1-4CD6-9C20-58E7AEFA2B43, OS:16.2, name:iPhone 13 mini }
[23:04:56]: ▸ { platform:iOS Simulator, id:947B2FF4-F8C4-4157-B28A-15CE4E0ADEC9, OS:16.2, name:iPhone 14 }
[23:04:56]: ▸ { platform:iOS Simulator, id:3C245358-17CA-4148-9761-9B43E4E7AF30, OS:16.2, name:iPhone 14 Plus }
[23:04:56]: ▸ { platform:iOS Simulator, id:AAD72F24-93F0-4733-B56B-02B633187556, OS:16.2, name:iPhone 14 Pro }
[23:04:56]: ▸ { platform:iOS Simulator, id:D6B0D4BD-B054-49D8-81C9-DE6B86DA8159, OS:16.2, name:iPhone 14 Pro Max }
[23:04:56]: ▸ { platform:iOS Simulator, id:E17DB22E-34B1-4E8C-8C69-4FE8DF7B0331, OS:16.2, name:iPhone SE (2nd generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:B5C432EF-F618-41E1-8867-2531AE3FFEEA, OS:16.2, name:iPhone SE (3rd generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:4E755AB3-CCEA-4CBD-9E34-7D328967BE68, OS:16.2, name:iPad (9th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:7003B45C-5D10-4B1F-9110-E8953DD40F98, OS:16.2, name:iPad (10th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:C7BB2AC8-D358-4E1F-AF9D-9036991B980A, OS:16.2, name:iPad Air (4th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:F8568F5F-A093-4FF7-8BF6-CD0884406B6E, OS:16.2, name:iPad Air (5th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:8AC066CE-AC08-4967-82F5-FDDBC65C5714, OS:16.2, name:iPad Pro (9.7-inch) }
[23:04:56]: ▸ { platform:iOS Simulator, id:26CFF07C-1AE7-47CC-94E4-076AFDD487FF, OS:16.2, name:iPad Pro (11-inch) (3rd generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:6284E1BE-4483-469C-B38E-8ECC8FE3F693, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:8B65B509-C332-44BD-9652-068C0BCD5570, OS:16.2, name:iPad Pro (12.9-inch) (5th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:F5DB4487-9E44-4E89-A758-19726493810D, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
[23:04:56]: ▸ { platform:iOS Simulator, id:1ACBD26B-FDEC-4C04-AFC6-5218C0AEBD39, OS:16.2, name:iPad mini (6th generation) }
[23:04:56]: ▸ resolved source packages: gRPC, SDWebImage, SwiftProtobuf, SDWebImageSwiftUI, GoogleUtilities, Drops, GoogleAppMeasurement, Promises, BoringSSL-GRPC, Firebase, nanopb, GTMSessionFetcher, GoogleDataTransport, leveldb, Alamofire, abseil
[23:04:56]: $ xcodebuild -showBuildSettings -scheme Development -project ./RecosiaIOS.xcodeproj
--- 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:2DDB1AC0-F8C8-4286-B863-619964C2FC5B, OS:16.2, name:iPhone 8 }
{ platform:iOS Simulator, id:0B620841-6614-48CC-A205-E5E09EB53653, OS:16.2, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:A2E7F989-640B-447D-86F6-F8BB40E5ED34, OS:16.2, name:iPhone 11 }
{ platform:iOS Simulator, id:105DDFE9-15CD-4662-984B-B06D28D29181, OS:16.2, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:2B9A63CF-8CAA-4595-B6D0-54EABC716032, OS:16.2, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:066A2CEE-78AC-461F-917D-0870C08AA2C1, OS:16.2, name:iPhone 12 }
{ platform:iOS Simulator, id:C9EDEB9E-9F3C-40A0-AFFB-BDA82D2F92ED, OS:16.2, name:iPhone 12 Pro }
{ platform:iOS Simulator, id:E4F654B1-E647-40A6-A886-5D451714A1AC, OS:16.2, name:iPhone 12 Pro Max }
{ platform:iOS Simulator, id:3D262786-0008-4204-871D-561465F42ADF, OS:16.2, name:iPhone 12 mini }
{ platform:iOS Simulator, id:8AC6E1D1-47D6-4A65-9706-2F8125E6987B, OS:16.2, name:iPhone 13 }
{ platform:iOS Simulator, id:CEAC2FC3-F123-47F2-9402-44F7C80C3605, OS:16.2, name:iPhone 13 Pro }
{ platform:iOS Simulator, id:82A937A7-5E83-426D-95AC-B4E0CE29B3F8, OS:16.2, name:iPhone 13 Pro Max }
{ platform:iOS Simulator, id:95A7220A-9CA1-4CD6-9C20-58E7AEFA2B43, OS:16.2, name:iPhone 13 mini }
{ platform:iOS Simulator, id:947B2FF4-F8C4-4157-B28A-15CE4E0ADEC9, OS:16.2, name:iPhone 14 }
{ platform:iOS Simulator, id:3C245358-17CA-4148-9761-9B43E4E7AF30, OS:16.2, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:AAD72F24-93F0-4733-B56B-02B633187556, OS:16.2, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:D6B0D4BD-B054-49D8-81C9-DE6B86DA8159, OS:16.2, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:E17DB22E-34B1-4E8C-8C69-4FE8DF7B0331, OS:16.2, name:iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:B5C432EF-F618-41E1-8867-2531AE3FFEEA, OS:16.2, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:4E755AB3-CCEA-4CBD-9E34-7D328967BE68, OS:16.2, name:iPad (9th generation) }
{ platform:iOS Simulator, id:7003B45C-5D10-4B1F-9110-E8953DD40F98, OS:16.2, name:iPad (10th generation) }
{ platform:iOS Simulator, id:C7BB2AC8-D358-4E1F-AF9D-9036991B980A, OS:16.2, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:F8568F5F-A093-4FF7-8BF6-CD0884406B6E, OS:16.2, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:8AC066CE-AC08-4967-82F5-FDDBC65C5714, OS:16.2, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:26CFF07C-1AE7-47CC-94E4-076AFDD487FF, OS:16.2, name:iPad Pro (11-inch) (3rd generation) }
{ platform:iOS Simulator, id:6284E1BE-4483-469C-B38E-8ECC8FE3F693, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:8B65B509-C332-44BD-9652-068C0BCD5570, OS:16.2, name:iPad Pro (12.9-inch) (5th generation) }
{ platform:iOS Simulator, id:F5DB4487-9E44-4E89-A758-19726493810D, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:1ACBD26B-FDEC-4C04-AFC6-5218C0AEBD39, OS:16.2, name:iPad mini (6th generation) }
2023-04-15 23:05:35.351 xcodebuild[6571:35175] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition

+--------------------------------------+-----------------------------------------------------------+
|                                     Summary for gym 2.212.1                                      |
+--------------------------------------+-----------------------------------------------------------+
| scheme                               | Development                                               |
| output_directory                     | ./Builds/1.0/6                                            |
| project                              | ./RecosiaIOS.xcodeproj                                    |
| clean                                | false                                                     |
| output_name                          | RecosiaIOS                                                |
| silent                               | false                                                     |
| skip_package_ipa                     | false                                                     |
| skip_package_pkg                     | false                                                     |
| build_path                           | /Users/runner/Library/Developer/Xcode/Archives/2023-04-15 |
| result_bundle                        | false                                                     |
| buildlog_path                        | ~/Library/Logs/gym                                        |
| destination                          | generic/platform=iOS                                      |
| xcodebuild_formatter                 | xcpretty                                                  |
| build_timing_summary                 | false                                                     |
| skip_profile_detection               | false                                                     |
| xcodebuild_command                   | xcodebuild                                                |
| skip_package_dependencies_resolution | false                                                     |
| disable_package_automatic_updates    | false                                                     |
| use_system_scm                       | false                                                     |
| xcode_path                           | /Applications/Xcode_14.2.app                              |
+--------------------------------------+-----------------------------------------------------------+

[23:05:35]: $ set -o pipefail && xcodebuild -scheme Development -project ./RecosiaIOS.xcodeproj -destination 'generic/platform=iOS' -archivePath /Users/runner/Library/Developer/Xcode/Archives/2023-04-15/RecosiaIOS\ 2023-04-15\ 23.05.35.xcarchive archive | tee /Users/runner/Library/Logs/gym/RecosiaIOS-Development.log | xcpretty
[23:06:24]: ▸ 2023-04-15 23:06:24.579 xcodebuild[7152:35304] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x60000b33fc00: name:Docs.docc path:group:Docs.docc> Failed to load container at path: /Users/runner/Library/Developer/Xcode/DerivedData/RecosiaIOS-bzzwtifvnypcgucljmpdkkzgplgs/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
[23:06:45]: ▸ ** ARCHIVE FAILED **
2023-04-15 23:06:24.579 xcodebuild[7152:35304] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x60000b33fc00: name:Docs.docc path:group:Docs.docc> Failed to load container at path: /Users/runner/Library/Developer/Xcode/DerivedData/RecosiaIOS-bzzwtifvnypcgucljmpdkkzgplgs/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
** ARCHIVE FAILED **
[23:06:45]: Exit status: 65
[23:06:45]: 
[23:06:45]: Maybe the error shown is caused by using the wrong version of Xcode
[23:06:45]: Found multiple versions of Xcode in '/Applications/'
[23:06:45]: Make sure you selected the right version for your project
[23:06:45]: This build process was executed using '/Applications/Xcode_14.2.app'
[23:06:45]: If you want to update your Xcode path, either
[23:06:45]: 
[23:06:45]: - Specify the Xcode version in your Fastfile
[23:06:45]: ▸ xcversion(version: "8.1") # Selects Xcode 8.1.0
[23:06:45]: 
[23:06:45]: - Specify an absolute path to your Xcode installation in your Fastfile
[23:06:45]: ▸ xcode_select "/Applications/Xcode8.app"
[23:06:45]: 
[23:06:45]: - Manually update the path using
[23:06:45]: ▸ sudo xcode-select -s /Applications/Xcode.app
[23:06:45]: 

+-------------+------------------------------+
|             Build environment              |
+-------------+------------------------------+
| xcode_path  | /Applications/Xcode_14.2.app |
| gym_version | 2.212.1                      |
| sdk         | iPhoneOS16.2.sdk             |
+-------------+------------------------------+

[23:06:45]: ▸ note: Building targets in dependency order
[23:06:45]: ▸ /Users/runner/work/Recosia-IOS/Recosia-IOS/RecosiaIOS.xcodeproj: error: No profiles for 'com.recosia.staging' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.recosia.staging'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'RecosiaIOS' from project 'RecosiaIOS')
[23:06:45]: ▸ note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'RecosiaIOS' from project 'RecosiaIOS')
[23:06:45]: ▸ /Users/runner/work/Recosia-IOS/Recosia-IOS/RecosiaIOS.xcodeproj: error: No profiles for 'com.recosia.staging.notification-service' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.recosia.staging.notification-service'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Notification Service' from project 'RecosiaIOS')
[23:06:45]: 
[23:06:45]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[23:06:45]: 📋  For the complete and more detailed error log, check the full log at:
[23:06:45]: 📋  /Users/runner/Library/Logs/gym/RecosiaIOS-Development.log
[23:06:45]: 
[23:06:45]: Looks like fastlane ran into a build/archive error with your project
[23:06:45]: It's hard to tell what's causing the error, so we wrote some guides on how
[23:06:45]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[23:06:45]: Before submitting an issue on GitHub, please follow the guide above and make
[23:06:45]: sure your project is set up correctly.
[23:06:45]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[23:06:45]: the full commands printed out in yellow in the above log.
[23:06:45]: Make sure to inspect the output above, as usually you'll find more error information there
[23:06:45]: 
[23:06:45]: --------------------------------
[23:06:45]: --- Step: get_version_number ---
[23:06:45]: --------------------------------
[23:06:45]: ------------------------------
[23:06:45]: --- Step: get_build_number ---
[23:06:45]: ------------------------------
[23:06:45]: $ cd /Users/runner/work/Recosia-IOS/Recosia-IOS && agvtool what-version -terse
[23:06:47]: ▸ 6
[23:06:47]: --------------------------
[23:06:47]: --- Step: notification ---
[23:06:47]: --------------------------
[23:06:47]: ------------------------------
[23:06:47]: --- Step: discord_notifier ---
[23:06:47]: ------------------------------
[23:06:47]: Notifying Discord
[23:06:47]: Fetching user data failed. Continuing anyway...

+------+---------------------------------------------------------------+-------------+
|                                  fastlane summary                                  |
+------+---------------------------------------------------------------+-------------+
| Step | Action                                                        | Time (in s) |
+------+---------------------------------------------------------------+-------------+
| 1    | update_fastlane                                               | 4           |
| 2    | default_platform                                              | 0           |
| 3    | app_store_connect_api_key                                     | 0           |
| 4    | setup_ci                                                      | 0           |
| 5    | git clone ***github.com/reco | 1           |
| 6    | get_version_number                                            | 0           |
| 7    | latest_testflight_build_number                                | 0           |
| 8    | increment_build_number                                        | 5           |
| 9    | get_build_number                                              | 0           |
| 10   | rm -rf ~/Library/Developer/Xcode/DerivedData                  | 0           |
| 💥   | build_app                                                     | 281         |
| 12   | get_version_number                                            | 0           |
| 13   | get_build_number                                              | 1           |
| 14   | notification                                                  | 0           |
| 15   | discord_notifier                                              | 0           |
+------+---------------------------------------------------------------+-------------+

[23:06:47]: fastlane.tools finished successfully 🎉
 I am trying to setup fastlane on GitHub Actions, and gym won't compile, but it will on device. 
fastlane-bot commented 1 year ago

It seems like you have not included the output of fastlane env To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env :+1:

brockw commented 1 year ago

Unity Cloud Build gets the same error at the moment. I just switched to using Git Actions and fast lane gym/build_app and am getting an issue similar to this. The build becomes frozen at Generating DSYM phase.

Mcrich23 commented 1 year ago

I think it has to do with a new way of Xcode signing

ali-ghani commented 1 year ago

I am getting the same error. Please can anyone guide how to resolve

INFO [2023-05-21 09:59:30.26]: ▸ ** ARCHIVE FAILED ** 2023-05-21 09:59:22.933 xcodebuild[9492:31638] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x6000004c9f00: name:Docs.docc path:group:Docs.docc> Failed to load container at path: /Users/runner/Library/Developer/Xcode/DerivedData/Digibank-gctiaovkhvqkvpaqodgxgtanwtgw/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}

Mcrich23 commented 1 year ago

@fastlane ideas?

herman-the-worm commented 1 year ago

Idea #1

Do not post your secrets in clear text on the internet

amzaandrei commented 1 year ago

i have the same problem here. I cannot run the gym command on my local computer (Intel Core Macbook Pro 2018) with the latest version of the fastlane: 2.214.0. @herman-the-worm haven't changed unfortunately nothing for me. I also get the same error: 'Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"'.

kraazie commented 1 year ago

@amzaandrei After integrating Firebase into my iOS project, I encountered this issue.

"Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"

The problem seems to be specific to the branch with Firebase, as the other branches build without any problems. What could be a potential solution to resolve this?

amzaandrei commented 1 year ago

@kraazie i use only SPM and i don't use Firebase. To be honest, i cannot explain it, but all of a sudden, it started working without changing anything. I cannot explain and don't ask me how it got resolved. It matters at the end that it works 😅