我使用GitLab CI自動爲Android和iOS構建應用程序。我的命令行構建適用於iOS不斷與錯誤而失敗:代碼簽名錯誤:SDK'iOS 11.0'中的產品類型'Application'需要代碼簽名。
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'
我現在用的是master
分支從cordova-ios
GitHub上。由於這具有以下修補程序,就像這裏說:After upgrading to xcode 9, cordova app won't build, error 70, requires provisioning profile
在我build.json
我使用以下設置:
{
"android": {
"debug": {
"keystore": "config/android.keystore",
"storePassword": "<pass>",
"alias": "debug",
"password" : "<pass>",
"keystoreType": ""
},
"release": {
"keystore": "config/android.keystore",
"storePassword": "<pass>",
"alias": "release",
"password" : "<pass>",
"keystoreType": ""
}
},
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<team id>",
"packageType": "development",
"buildFlag": [
"EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
"LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
],
"iCloudContainerEnvironment": "Development"
},
"release": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<team id>",
"packageType": "app-store",
"buildFlag": [
"EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
"LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
],
"iCloudContainerEnvironment": "Production"
}
}
}
我使用iCloudContainerEnvironment
因爲我需要推啓用。我使用正確的配置文件開始構建過程。我使用CLI參數來做這件事,因爲我爲幾個不同的應用程序IDS構建應用程序:cordova build ios --device --provisioningProfile=<uuid>
但無論我做什麼或嘗試它都不會簽署應用程序並一直拋出錯誤。
編輯:
基於@Jerry霍頓建議我增加了供應配置文件到build.json
文件。我試着用配置文件名稱和配置文件UUID。這兩種情況下會引發以下錯誤,並沒有exportOptions.plist
是在platforms/ios/
目錄中找到:
Code Signing Error: Provisioning profile "iOS Team Provisioning Profile: nl.XXX.loc.app" is Xcode managed, but signing settings require a manually managed profile.
我甚至去掉所有的插件,以確保沒有人站在道路。所以我build.json
現在看起來是這樣的:
{
"android": {
"debug": {
"keystore": "config/android.keystore",
"storePassword": "<pass>",
"alias": "debug",
"password" : "<pass>",
"keystoreType": ""
},
"release": {
"keystore": "config/android.keystore",
"storePassword": "<pass>",
"alias": "release",
"password" : "<pass>",
"keystoreType": ""
}
},
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<team id>",
"provisioningProfile": "<nl.XXX.loc.app or UUID>",
"packageType": "development",
"buildFlag": [
"EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
"LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
],
"iCloudContainerEnvironment": "Development"
},
"release": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<team id>",
"packageType": "app-store",
"provisioningProfile": "<nl.XXX.app or UUID>",
"buildFlag": [
"EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
"LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
],
"iCloudContainerEnvironment": "Production"
}
}
}
ExportOptions.plist:
當我手動開運Xcode和創建調試存檔/導出手動我得到一個IPA和此文件夾中有是ExportOptions.plist
,像這樣:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>method</key>
<string>development</string>
<key>provisioningProfiles</key>
<dict>
<key>nl.XXX.loc.app</key>
<string>nl.XXX.loc.app</string>
</dict>
<key>signingCertificate</key>
<string>iPhone Developer</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>TEAMID</string>
<key>thinning</key>
<string><none></string>
</dict>
</plist>
我真的看不出這裏有什麼問題。也許稀疏的部分?
仍然沒有運氣,我編輯了一些輸出的問題。感謝您的時間和幫助 –
如果我執行命令'離子cordova build ios --debug'而不是'ionic cordova build ios --device',那麼構建會成功。但是,我沒有得到任何IPA文件或任何'exportOptions.plist'文件 –
是的, - 設備選項構建.ipa安裝在iPhone上。從Xcode 9開始,設備構建需要exportOptions.plist包含一些新的必需字段。不幸的是,這個文件是在運行「cordova build」命令時動態創建的。如果您按照https://stackoverflow.com/questions/46344443/after-upgrading-to-xcode-9-cordova-app-wont-build-error-70-requires-provisio/46370957#46370957中所述填充字段每次都會工作。 –