升級Xcode16后打包機出現(xiàn)了個問題,現(xiàn)在解決了,在此記錄下,順便幫助有需要的人
之前打包機都是用XCodeBuild工具編譯,其中exportArchive步驟命令是
xcodebuild -exportArchive \
-archivePath ${ARCHIVE_PATH} \
-exportPath "${IPA_PATH}" \
-exportOptionsPlist ${EXPORT_METHOD_PLIST_PATH} \
-allowProvisioningUpdates YES
這條命令在Xcode15時都是好的; 升級了Xcode16后,遇到了個問題,會導(dǎo)致兩個報錯
1.編譯步驟報錯,具體log如下
** ARCHIVE SUCCEEDED **
/var/folders/ch/1mvd9gz11cn8zy9h254qz2600000gn/T/jenkins6531487518988891980.sh: line 194: -allowProvisioningUpdates: command not found
+++++++++++++++++ipa+++++++++++++++++
2024-10-10 18:20:35.630 xcodebuild[58030:2528109] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/ch/1mvd9gz11cn8zy9h254qz2600000gn/T/xxxxxx_2024-10-10_18-20-35.623.xcdistributionlogs".
2024-10-10 18:20:35.724 xcodebuild[58030:2528191] DVTDeveloperAccountManager: Failed to load credentials for xxxxxxxxxx: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for xxxxxxxxxx, missing Xcode-Username" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for xxxxxxxxxx, missing Xcode-Username}
2024-10-10 18:20:35.733 xcodebuild[58030:2528191] DVTDeveloperAccountManager: Failed to load credentials for F38D3CD7-C794-4F88-93ED-4FDDD8EDF72B: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for F38D3CD7-C794-4F88-93ED-4FDDD8EDF72B, missing Xcode-Username" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for F38D3CD7-C794-4F88-93ED-4FDDD8EDF72B, missing Xcode-Username}
2024-10-10 18:20:35.742 xcodebuild[58030:2528191] DVTDeveloperAccountManager: Failed to load credentials for ***@***.com: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for ***@***.com, missing Xcode-Token" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for ***@***.com, missing Xcode-Token}
2024-10-10 18:20:40.521 xcodebuild[58030:2528195] IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account ''." UserInfo={NSLocalizedFailureReason=Unable to log in with account ''., NSLocalizedRecoverySuggestion=The login details for account '' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x600002d92a80; username=''>, NSUnderlyingError=0x600002758ab0 {Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
creationTimestamp = "2024-10-10T10:20:40Z";
httpCode = 200;
protocolVersion = QH65B2;
requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
responseId = "12827504-3d86-4601-bcf7-efc0dccb0655";
resultCode = 1100;
resultString = "Your session has expired. Please log in.";
userLocale = "en_US";
userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}}})
2024-10-10 18:20:40.760 xcodebuild[58030:2528195] IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account ''." UserInfo={NSLocalizedFailureReason=Unable to log in with account ''., NSLocalizedRecoverySuggestion=The login details for account '' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x600002de7e80; username=''>, NSUnderlyingError=0x6000027842d0 {Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
creationTimestamp = "2024-10-10T10:20:40Z";
httpCode = 200;
protocolVersion = QH65B2;
requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
responseId = "e49c99d0-861c-4d80-9cd7-8430bcdfa6a6";
resultCode = 1100;
resultString = "Your session has expired. Please log in.";
userLocale = "en_US";
userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}}})
2024-10-10 18:20:41.053 xcodebuild[58030:2528195] IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account '***@***.com'." UserInfo={NSLocalizedFailureReason=Unable to log in with account '***@***.com'., NSLocalizedRecoverySuggestion=The login details for account '***@***.com' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x600002de7b80; username='***@***.com'>, NSUnderlyingError=0x6000027a4780 {Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
creationTimestamp = "2024-10-10T10:20:41Z";
httpCode = 200;
protocolVersion = QH65B2;
requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
responseId = "5819c66e-bd35-4af3-ae6a-0e66193fa2bb";
resultCode = 1100;
resultString = "Your session has expired. Please log in.";
userLocale = "en_US";
userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}}})
error: exportArchive The operation couldn’t be completed. Unable to log in with account ''.
error: exportArchive Provisioning profile "iOS Team Store Provisioning Profile: com.xxxx.xxxxx" doesn't include signing certificate "Apple Distribution: xxxxxxxxxxx".
** EXPORT FAILED **
2. Xcode-settings-accounts欄目中會出現(xiàn)一堆空白的報錯賬戶,具體如下
630f07a9-bb2e-4f5b-a872-0fc7bb7a88d2.png
解決辦法
一開始怎么都不能解決,谷歌也沒搜到相同的問題,最后去問蘋果工程師,給出了解決方法:
終端執(zhí)行命令: defaults delete com.apple.dt.Xcode DVTDeveloperAccountManagerAppleIDLists
這個會把所有的Xcode開發(fā)賬號全部刪掉,然后再重新登錄開發(fā)者賬號,就會發(fā)現(xiàn)問題解決了.猜想升級Xcode16后應(yīng)該是哪個賬戶報錯了導(dǎo)致的這個問題,刪掉就好了
新的問題
上面的問題解決后,又出現(xiàn)了新的問題,每次打包都會失敗,報錯配置文件不包括簽名證書,而且開發(fā)者賬號也會被退出登錄,報錯如下:
** ARCHIVE SUCCEEDED **
2024-11-08 16:19:54.360 xcodebuild[36487:6743710] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/ch/1mvd9gz11cn8zy9h254qz2600000gn/T/***.xcdistributionlogs".
error: exportArchive No Accounts
error: exportArchive Provisioning profile "iOS Team Store Provisioning Profile: com.***" doesn't include signing certificate "Apple Distribution: *** Co Ltd (***)".
** EXPORT FAILED **
解決辦法
~/Library/MobileDevice/Provisioning Profiles
目錄下都是配置文件,刪掉文件夾
刪除緩存
重登陸開發(fā)者賬號,并下載各種配置