Ios fastlane finished with errors - gym - archived failed

I have just recently updated my capacitor and libraries to v5. It fully builds and works locally. However, the appflow pipeline fails to build the app. Locally I am using xcode 15. Appflow is using xcode 14, not sure if this could be the issue. Below is the stack:

[CapacitorKeyboard] Compiling CapacitorKeyboard_vers.c
[CapacitorKeyboard] Compiling CapacitorKeyboard-dummy.m
[SentryCapacitor] Compiling SentryCapacitor_vers.c
[SentryCapacitor] Compiling SentryCapacitor-dummy.m
[SentryCapacitor] Compiling Plugin.m
[CapacitorSplashScreen] Compiling SplashScreenPlugin.m
[CapacitorSplashScreen] Compiling CapacitorSplashScreen_vers.c
[CapacitorSplashScreen] Compiling CapacitorSplashScreen-dummy.m
[CapacitorKeyboard] Generating CapacitorKeyboard.framework.dSYM
[CapacitorPushNotifications] Compiling PushNotificationsPlugin.m
[CapacitorPushNotifications] Compiling CapacitorPushNotifications_vers.c
[SentryCapacitor] Generating SentryCapacitor.framework.dSYM
[CapacitorPushNotifications] Compiling CapacitorPushNotifications-dummy.m
[CapacitorSplashScreen] Generating CapacitorSplashScreen.framework.dSYM
Signing SentryCapacitor.framework (in target 'SentryCapacitor' from project 'Pods')
Signing CapacitorSplashScreen.framework (in target 'CapacitorSplashScreen' from project 'Pods')
[SentryCapacitor] Touching SentryCapacitor.framework
Signing CapacitorRateApp.framework (in target 'CapacitorRateApp' from project 'Pods')
[CapacitorSplashScreen] Touching CapacitorSplashScreen.framework
[CapacitorPushNotifications] Generating CapacitorPushNotifications.framework.dSYM
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:32:46: conditional downcast from 'String?' to 'String' does nothing
        let appId = call.getString("appId")  as? String ?? "NO_APP_ID_PASSED"
                    ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:33:50: conditional downcast from 'String?' to 'String' does nothing
        let apiKey = call.getString("apiKeyIOS") as? String ?? "NO_API_KEY_PASSED"
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:37:158: 'DidRegisterForRemoteNotificationsWithDeviceToken' is deprecated: renamed to 'Notification.Name.capacitorDidRegisterForRemoteNotifications'
        NotificationCenter.default.addObserver(self, selector: #selector(self.didRegisterWithToken(notification:)), name: Notification.Name(CAPNotifications.DidRegisterForRemoteNotificationsWithDeviceToken.name()), object: nil)
                                                                                                                                                             ^
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:119:18: 'presentMessenger()' is deprecated: '+[Intercom presentMessenger]' is deprecated and will be removed in a future release. 'Use +[Intercom presentIntercom]' instead.
        Intercom.presentMessenger();
                 ^
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:133:18: 'presentHelpCenter()' is deprecated: '+[Intercom presentHelpCenter]' is deprecated and will be removed in a future release. 'Use +[Intercom presentIntercom:HelpCenter]' instead.
        Intercom.presentHelpCenter()
                 ^
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:164:22: 'presentCarousel' is deprecated: '+[Intercom presentCarousel:]' is deprecated and will be removed in a future release. 'Use +[Intercom presentContent:carousel contentId:]' instead.
            Intercom.presentCarousel(carouselId)
                     ^
⚠️  /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/node_modules/@capacitor-community/intercom/ios/Plugin/IntercomPlugin.swift:198:22: 'presentArticle' is deprecated: '+[Intercom presentArticle:]' is deprecated and will be removed in a future release. 'Use +[Intercom presentContent:article contentId:]' instead.
            Intercom.presentArticle(articleId)
                     ^
[CapacitorRateApp] Touching CapacitorRateApp.framework
Signing CapacitorKeyboard.framework (in target 'CapacitorKeyboard' from project 'Pods')
[CapacitorKeyboard] Touching CapacitorKeyboard.framework
Signing CapacitorPushNotifications.framework (in target 'CapacitorPushNotifications' from project 'Pods')
[CapacitorIosAutofillSavePassword] Compiling Plugin.m
[CapacitorIosAutofillSavePassword] Compiling CapacitorIosAutofillSavePassword_vers.c
[CapacitorIosAutofillSavePassword] Compiling CapacitorIosAutofillSavePassword-dummy.m
[CapacitorIosAutofillSavePassword] Generating CapacitorIosAutofillSavePassword.framework.dSYM
[CapacitorPushNotifications] Touching CapacitorPushNotifications.framework
[CapacitorBrowser] Copying CapacitorBrowser-umbrella.h
[CapacitorBrowser] Copying BrowserPlugin.h
[CapacitorBrowser] Processing CapacitorBrowser-Info.plist
[CapacitorDevice] Compiling DevicePlugin.m
[CapacitorDevice] Compiling CapacitorDevice_vers.c
[CapacitorDevice] Compiling CapacitorDevice-dummy.m
[CapacitorApp] Copying CapacitorApp-umbrella.h
[CapacitorApp] Copying AppPlugin.h
[CapacitorClipboard] Compiling Plugin.m
[CapacitorDevice] Generating CapacitorDevice.framework.dSYM
[CapacitorClipboard] Compiling CapacitorClipboard_vers.c
[CapacitorClipboard] Compiling CapacitorClipboard-dummy.m
[CapacitorApp] Processing CapacitorApp-Info.plist
Signing CapacitorIosAutofillSavePassword.framework (in target 'CapacitorIosAutofillSavePassword' from project 'Pods')
[CapacitorIosAutofillSavePassword] Touching CapacitorIosAutofillSavePassword.framework
[CapacitorBrowser] Compiling CapacitorBrowser_vers.c
[CapacitorBrowser] Compiling CapacitorBrowser-dummy.m
[CapacitorBrowser] Compiling BrowserPlugin.m
[CapacitorClipboard] Generating CapacitorClipboard.framework.dSYM
Signing CapacitorDevice.framework (in target 'CapacitorDevice' from project 'Pods')
[CapacitorDevice] Touching CapacitorDevice.framework
[CapacitorBrowser] Generating CapacitorBrowser.framework.dSYM
Signing CapacitorClipboard.framework (in target 'CapacitorClipboard' from project 'Pods')
[CapacitorClipboard] Touching CapacitorClipboard.framework
Signing CapacitorBrowser.framework (in target 'CapacitorBrowser' from project 'Pods')
[CapacitorBrowser] Touching CapacitorBrowser.framework
[CapacitorApp] Compiling CapacitorApp_vers.c
[CapacitorApp] Compiling CapacitorApp-dummy.m
[CapacitorApp] Compiling AppPlugin.m
[CapacitorCommunityIntercom] Compiling IntercomPlugin.m
[CapacitorCommunityIntercom] Compiling CapacitorCommunityIntercom_vers.c
[CapacitorCommunityIntercom] Compiling CapacitorCommunityIntercom-dummy.m
[CapacitorApp] Generating CapacitorApp.framework.dSYM
Signing CapacitorApp.framework (in target 'CapacitorApp' from project 'Pods')
[CapacitorApp] Touching CapacitorApp.framework
[CapacitorCommunityIntercom] Generating CapacitorCommunityIntercom.framework.dSYM
Signing CapacitorCommunityIntercom.framework (in target 'CapacitorCommunityIntercom' from project 'Pods')
[CapacitorCommunityIntercom] Touching CapacitorCommunityIntercom.framework
[Pods-App] Copying Pods-App-umbrella.h
[Pods-App] Processing Pods-App-Info.plist
[Pods-App] Compiling Pods-App-dummy.m
[Pods-App] Compiling Pods_App_vers.c
Signing Pods_App.framework (in target 'Pods-App' from project 'Pods')
[Pods-App] Touching Pods_App.framework
⚠️ 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')
[App] Running script [CP] Check Pods Manifest.lock
[App] Copying public
[App] Copying config.xml
[App] Copying capacitor.config.json
[App] Compiling Main.storyboard
[App] Compiling LaunchScreen.storyboard
[App] Processing Info.plist
[App] Generating App.app.dSYM
[App] Running script [CP] Embed Pods Frameworks
⚠️ Run script build phase '[CP] Copy XCFrameworks' 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 'Intercom' from project 'Pods')
⚠️ Run script build phase '[CP] Copy XCFrameworks' 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 'FBSDKCoreKit_Basics' from project 'Pods')
⚠️ Run script build phase '[CP] Copy XCFrameworks' 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 'FBAEMKit' from project 'Pods')
⚠️ Run script build phase '[CP] Copy XCFrameworks' 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 'FBSDKCoreKit' from project 'Pods')
** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/ionic-cloud-team/Library/Developer/Xcode/DerivedData/App-gzqszgtzmuaznmcpaghuwjunnskt/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh (in target 'App' from project 'App')
(1 failure)
[18:37:19]: Exit status: 65

+---------------+-------------------------+
|            Build environment            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.213.0                 |
| export_method | app-store               |
| sdk           | iPhoneOS16.4.sdk        |
+---------------+-------------------------+

[18:37:19]: ▸ warning: Run script build phase '[CP] Copy XCFrameworks' 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 'Intercom' from project 'Pods')
[18:37:19]: ▸ warning: Run script build phase '[CP] Copy XCFrameworks' 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 'FBSDKCoreKit_Basics' from project 'Pods')
[18:37:19]: ▸ warning: Run script build phase '[CP] Copy XCFrameworks' 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 'FBAEMKit' from project 'Pods')
[18:37:19]: ▸ warning: Run script build phase '[CP] Copy XCFrameworks' 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 'FBSDKCoreKit' from project 'Pods')
[18:37:19]: 
[18:37:19]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[18:37:19]: 📋  For the complete and more detailed error log, check the full log at:
[18:37:19]: 📋  /Users/ionic-cloud-team/Library/Logs/gym/App-App.log
[18:37:19]: 
[18:37:19]: Looks like fastlane ran into a build/archive error with your project
[18:37:19]: It's hard to tell what's causing the error, so we wrote some guides on how
[18:37:19]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[18:37:19]: Before submitting an issue on GitHub, please follow the guide above and make
[18:37:19]: sure your project is set up correctly.
[18:37:19]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[18:37:19]: the full commands printed out in yellow in the above log.
[18:37:19]: Make sure to inspect the output above, as usually you'll find more error information there
[18:37:19]: 
[18:37:19]: -------------------------
[18:37:19]: --- Step: upload_logs ---
[18:37:19]: -------------------------
[18:37:33]: ---------------------------
[18:37:33]: --- Step: shell command ---
[18:37:33]: ---------------------------
[18:37:33]: -----------------------------
[18:37:33]: --- Step: delete_keychain ---
[18:37:33]: -----------------------------
[18:37:33]: Error building the application - see the log above
+-------------------------------------+-------------------------------------------------------------------------------------------------------------+
|                                                                   Lane Context                                                                    |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM                    | ios                                                                                                         |
| PLATFORM_NAME                       | ios                                                                                                         |
| LANE_NAME                           | ios build_capacitor                                                                                         |
| KEYCHAIN_PATH                       | ~/Library/Keychains/IonicKeychain                                                                           |
| DOWNLOAD_CERTS_PROVISION_FILE_UUID  | b8db4f6b-8d87-4f7a-b909-0b5e005c1f06                                                                        |
| DOWNLOAD_CERTS_CODESIGNING_IDENTITY | Apple Distribution: Pigeon Loans inc. (3573C6Q54B)                                                          |
| DOWNLOAD_CERTS_TEAM_ID              | 3573C6Q54B                                                                                                  |
| DOWNLOAD_CERTS_CERT_PATH            | /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/cert_file.p12                                            |
| SIGH_PROFILE_PATHS                  | ["/Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/b8db4f6b-8d87-4f7a-b909-0b5e005c1f06.mobileprovision"] |
| IONIC_CLI_VERSION                   | 7.1.1                                                                                                       |
| NODE_PACKAGE_MANAGER                | npm                                                                                                         |
| CAP_IOS_PATH                        | /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/ios                                                      |
| PROJECT_WEB_DIR                     | build                                                                                                       |
| XCODE_PROJECT_NAME                  | App                                                                                                         |
| XCODE_PROJECT_PATH                  | /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/ios/App/App.xcodeproj                                    |
| XCODE_WORKSPACE_PATH                | /Users/ionic-cloud-team/builds/Pigeon-Loans/pigeon/ios/App/App.xcworkspace                                  |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------+
[18:37:33]: Error building the application - see the log above

+------+------------------------------+-------------+
|                 fastlane summary                  |
+------+------------------------------+-------------+
| Step | Action                       | Time (in s) |
+------+------------------------------+-------------+
| 1    | add_extra_platforms          | 0           |
| 2    | default_platform             | 0           |
| 3    | begin_building               | 0           |
| 4    | build_summary                | 4           |
| 5    | create_keychain              | 0           |
| 6    | download_certs               | 1           |
| 7    | import_certificate           | 0           |
| 8    | set_ionic_cli                | 1           |
| 9    | detect_package_manager       | 0           |
| 10   | add_git_credentials          | 0           |
| 11   | get_appflow_config           | 0           |
| 12   | dependency_install           | 170         |
| 13   | create_capacitor_config      | 1           |
| 14   | get_web_dir                  | 0           |
| 15   | modify_cap_web_config        | 0           |
| 16   | build_pro_app                | 126         |
| 17   | get_xcode_project_paths      | 0           |
| 18   | modify_ios_config            | 0           |
| 19   | install_cocoapods            | 10          |
| 20   | cap_sync                     | 44          |
| 21   | cap_custom_deploy            | 0           |
| 22   | update_code_signing_settings | 0           |
| 23   | update_provisioning_profiles | 0           |
| 💥   | gym                          | 68          |
| 25   | upload_logs                  | 14          |
| 26   | shell command                | 0           |
| 27   | delete_keychain              | 0           |
+------+------------------------------+-------------+

[18:37:33]: fastlane finished with errors

[!] Error building the application - see the log above
Running after_script
Running after script...
$ clean-up
Cleaning up project directory and file based variables
Terminating VM: build_stack_2023.06-1698172163575433000 (e09eadd0-0bf9-4d09-95b1-2d92113970b7) | Controller Instance ID: b8b78ac8-a135-41ae-7654-71698c219f68 | Host: 10.2.171.152
ERROR: Job failed: Process exited with status 1

Env Details:

Cordova CLI: 12.0.0
Ionic CLI: 7.1.1
Node.js: 18.16.0
npm: 8.19.4
Yarn: 1.22.19
Python: 3
macOS: 12.6
Carthage: 0.39.0
CocoaPods: 1.12.1
Xcode: 14.3.1

Been stuck on this issue for about 2 weeks now. Would love any help or feedback.

1 Like

You can build using Xcode 15 by choosing the macOS - 2023.09 stack on the “create new build” screen of appflow, there is a Build stack chooser.
Give that a try and if it still fails you should probably contact support.

Did you resolve this? We have just hit the same issue after updating to v5.

I am also able to build locally, as are 2 other developers, however our AppFlow builds are failing for iOS with the same issue.

I just tried a build in Xcode 15 as suggested, but getting the same error.

The following build commands failed:
	PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/ionic-cloud-team/Library/Developer/Xcode/DerivedData/App-fvcyluqbaejxdcegrdupxgjzayvj/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh (in target 'App' from project 'App')
(1 failure)
[03:16:04]: Exit status: 65
1 Like