我有一个 ionic 项目,它使用电容器。我项目的环境信息显示如下:
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 │
│ │
╰─────────────────────────────────────╯
为了构建和部署项目,该项目使用了 FaSTLane。应用程序自动进行代码签名。
FaSTLane 的健身房看起来像:
gym(
scheme: IOS_SCHEME,
workspace: IOS_WORKSPACE,
export_method: EXPORT_METHOD[releaseType],
export_xcargs: '-allowProvisioningUpdates',
export_options: {
'signingStyle': 'automatic',
'compileBitcode': false
}
)
突然,几个月后构建开始失败,错误代码为 65。 这是构建失败消息:
[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
经过大量谷歌搜索,尝试了许多解决方案,但失败..!! 已经尝试了以下解决方案:
- 钥匙串(keychain)解锁和锁定。
- 检查有效证书并删除过期证书。
- 将钥匙串(keychain)密码设置为分区列表。
- 重启 Mac。
- 重复钥匙串(keychain)条目管理
- 将 post_install 添加到 pod 文件。为 pod 框架禁用代码签名
pod install
使用 FaSTLane。- 清除派生数据目录和模块文件夹。
Podfile 如下所示:
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
适用于 Mac-mini 的 Cocoapods 版本是 1.7.4
这里的第一个问题是,Xcode 版本需要更新到 10 吗?
第二个问题,faSTLane 版本重要吗?当前使用的 faSTLane 版本是:2.105.2
如何解决存档失败的问题?所需的证书均已正确安装。从几天开始尝试这个,但仍然停留在这里。
如有任何帮助,我们将不胜感激!
最佳答案
Capacitor 需要 Xcode 10 或更新版本,因为最新版本使用 Swift 4.2,这在 Xcode 9 上不可用
关于ios - xcodebuild : Command failed with exit code 65 in Ionic Capacitor Application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57094848/