0

我已将 Flutter 应用程序更新到 Flutter 2.2.1 版 • channel stable,但是当它在 ios 设备上运行 flutter run 时出现以下错误,这是什么原因造成的?我该如何解决?我在网上阅读并且有几个人遇到这些问题,在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')
4

1 回答 1

0

在我的情况下,运行以下帮助了我

$ flutter clean && flutter create .

于 2021-06-23T08:05:43.717 回答