我試圖生成 ipa 檔案以將其上傳到 App Store,但不幸的是它失敗并顯示“為設備歸檔時遇到錯誤”。我也嘗試過從 Xcode 存檔,但是存檔也失敗了。它在 ios 模擬器中運行良好 (13)
無法構建 iOS 應用 Xcode 構建的錯誤輸出:? ** ARCHIVE FAILED **
Xcode 的輸出:在路徑中寫入結果包:
/var/folders/8s/2st2j0d97k7cm80h3968jnx80000gn/T/flutter_tools.ph1v
kd/flutter_ios_build_temp_dirZbRdRw/temporary_xcresult_bundle
error: the following command failed with exit code 0 but produced no
further output
CompileC
Failed to package /Users/sunsoft/Downloads/alifpet-app-master.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'Sodium' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'ReachabilitySwift' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'Starscream' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 6.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'Reachability' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 7.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'AppAuth' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'PusherSwiftWithEncryption' from project
'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'GoogleSignIn' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'AgoraRtcEngine_iOS' from project 'Pods')
Result bundle written to path:
/var/folders/8s/2st2j0d97k7cm80h3968jnx80000gn/T/flutter_tools.ph1v
kd/flutter_ios_build_temp_dirZbRdRw/temporary_xcresult_bundle
Encountered error while archiving for device.
uj5u.com熱心網友回復:
這里的問題是 Flutter 模板默認創建的 Podfile 沒有設定特定的 iOS 版本。
這樣做可以解決這個問題:
- 在
ios/專案的檔案夾中,打開Podfile. - 在頂部
Podfile,確保此行沒有被注釋掉,并將 iOS 版本更改為 12.0。
更改自:
#platform :ios, '8.0'
到:
platform :ios, '12.0'
在專案檔案夾
pod deintegrate內的終端中運行。ios/pod install --repo-update在您的ios/檔案夾中運行
這應該可以解決問題!
如果在此之后您收到以下錯誤
CocoaPods 沒有設定您專案的基本配置,因為您的專案已經有一個自定義配置集。為了使 CocoaPods 集成能夠正常作業,請設定目標的基本配置
然后您需要在 Xcode 中打開您的 iOS 作業區并選擇左上角的根專案,然后在 Info 選項卡中,選擇您的配置(在本例中為 Debug)并將其更改為 None。之后,再次執行 pod install。

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/430008.html
