如何解决Flutter 给我 CompileSwift 失败,退出代码非零
我已将 Flutter 应用程序更新到 Flutter 2.2.1 版 • 通道稳定,但是当它在 ios 设备上运行 flutter run 时出现以下错误,这是什么原因造成的?我该如何解决? 我在网上阅读,有几个人遇到了这些问题,在 Flutter 更新后出现错误,但由于我必须使用最新版本的 Flutter,我必须找到解决错误的方法,我该如何解决?
flutter 运行时出错:
Error output from Xcode build:
↳
objc[69849]: Class AMSupportURLConnectionDelegate is implemented in both ??
(0x1f9b08188) and ?? (0x1166cc2b8). One of the two will be used. Which one is
undefined.
objc[69849]: Class AMSupportURLSession is implemented in both ?? (0x1f9b081d8) and ??
(0x1166cc308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
In file included from
/Users/utente/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Class
es/SharedPreferencesPlugin.m:5:
/Users/utente/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Class
es/SharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from
/Users/utente/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Class
es/SharedPreferencesPlugin.m:5:
/Users/utente/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Class
es/SharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'shared_preferences' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'printing' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'mp3_meta_data' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'location' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'image_cropper' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'google_maps_flutter' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'flutter_local_notifications' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'barcode_scan' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'package_info' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'advance_pdf_viewer' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'flutter_image_media' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'sqflite' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'path_provider' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'image_picker' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'flutter_email_sender' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'TOCropViewController-TOCropViewControllerBundle' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'TOCropViewController' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'MTBBarcodeScanner' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'FMDB' from project 'Pods')
/Users/utente/Desktop/Progetti/Gitlab/appflutter/quote/ios/Pods/Pods.xcodeproj:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to
8.0,but the range of supported deployment target versions is 9.0 to 14.5.99. (in
target 'Flutter' from project 'Pods')
解决方法
就我而言,运行以下命令对我有帮助
$ flutter clean && flutter create .
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。