DP63
DP63

Reputation: 67

xcodebuild: Command failed with exit code 65 in Ionic Capacitor Application

I have an ionic project and it uses a capacitor. The environment info for my project shows something like:

Ionic:

   ionic (Ionic CLI)  : 4.1.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework: ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Capacitor:

   capacitor (Capacitor CLI) : 1.1.0
   @capacitor/core           : 1.1.0

Cordova:

   cordova (Cordova CLI) : 7.0.0
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   Android SDK Tools : 26.1.1 (/Users/iosbuild/Library/Android/sdk)
   NodeJS            : v9.4.0 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000



   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 4.1.1 → 5.2.3    │
   │    Run npm i -g ionic to update     │
   │                                     │
   ╰─────────────────────────────────────╯

To build & deploy the project, the project uses Fastlane. The Application is code-signed automatically.

The Gym of Fastlane looks like:

gym(
      scheme: IOS_SCHEME,
      workspace: IOS_WORKSPACE,
      export_method: EXPORT_METHOD[releaseType],
      export_xcargs: '-allowProvisioningUpdates',
      export_options: {
        'signingStyle': 'automatic',
        'compileBitcode': false
      }
    )

Suddenly, after a few months the build started failing with Error Code 65. Here is the build failure message :

[33m▸[0m [39;1mProcessing[0m Info.plist
[33m▸[0m [39;1mGenerating 'App.app.dSYM'[0m
[33m▸[0m [39;1mRunning script[0m '[CP] Embed Pods Frameworks'
** ARCHIVE FAILED **


The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/iosbuild/Library/Developer/Xcode/DerivedData/App-fdavtmgcrorkxicfvghtsxxtwfeo/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh
(1 failure)
[09:28:20]: [31mExit status: 65[0m

+---------------+-------------------------+
|            [32m[33mBuild environment[0m            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.105.2                 |
| export_method | enterprise              |
| SDK           | iPhoneOS11.4.SDK        |
+---------------+-------------------------+

[09:28:20]: ▸ [35mtotal size is 10252820  speedup is 1.00[0m
[09:28:20]: ▸ [35mCode Signing /Users/iosbuild/Library/Developer/Xcode/DerivedData/App-fdavtmgcrorkxicfvghtsxxtwfeo/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications//App.app/Frameworks/Capacitor.framework with Identity iPhone Developer: XXXX XXXX (XXXXXXXXX)[0m
[09:28:20]: ▸ [35m/usr/bin/codesign --force --sign <[Some alphanumeric text]>  --preserve-metadata=identifier,entitlements '/Users/iosbuild/Library/Developer/Xcode/DerivedData/App-fdavtmgcrorkxicfvghtsxxtwfeo/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications//App.app/Frameworks/Capacitor.framework'[0m
[09:28:20]: ▸ [35m/Users/iosbuild/Library/Developer/Xcode/DerivedData/App-fdavtmgcrorkxicfvghtsxxtwfeo/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications//App.app/Frameworks/Capacitor.framework: errSecInternalComponent[0m
[09:28:20]: ▸ [35mCommand /bin/sh failed with exit code 1[0m

After lots of googling, many solutions have been tried out, but Failure..!! Following solutions are already tried:

Podfile looks like below:

platform :ios, '11.0'
use_frameworks!

# workaround to avoid Xcode 10 caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true

def capacitor_pods
  # Automatic Capacitor Pod dependencies, do not delete
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
  pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins'
  # Do not delete
end

target 'App' do
  capacitor_pods
  # Add your Pods here
end

Cocoapods version for Mac-mini is, 1.7.4

First Question here is, Does the Xcode version needs to be updated to 10?

SecondQuestion, Does the fastlane version matters? Current fastlane version used is : 2.105.2

How can I solve this Archive Failed issue? The certificates required are all correctly installed. Trying this from days and still stuck here.

Any help would be appreciated!

Upvotes: 3

Views: 3707

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53301

Capacitor requires Xcode 10 or newer as latest version uses Swift 4.2, which is not available on Xcode 9

Upvotes: 1

Related Questions