首页 > 解决方案 > Flutter:现有应用程序无法在 ios 中运行

问题描述

我开始在 ios 中调试此代码,但告诉我此错误,但 android 中的代码运行没有错误

这是我的安装插件:

cupertino_icons: ^0.1.2
  flutter_swiper: ^1.1.6
  mvc_pattern: ^3.4.1
  global_configuration: ^1.3.0
  http: ^0.12.0+2
  intl: ^0.16.0
  html: ^0.14.0+2
  shared_preferences: ^0.5.6
  flutter_html: ^0.10.4
  flutter_svg: ^0.17.4
  location: ^2.3.5
  dynamic_theme: ^1.0.0
  flutter_inappbrowser: ^1.2.2
  url_launcher: ^5.4.1
  firebase_messaging: ^6.0.13
  firebase_analytics: ^5.0.11
  cached_network_image: 2.0.0-rc
  flutter_sidekick: ^0.1.3
  rflutter_alert: ^1.0.3
  geolocator: ^5.3.1
  google_maps_flutter: ^0.5.26
  flushbar: ^1.10.0
  sms_autofill: ^1.2.1
  timer_count_down: ^1.0.1
  # flutter_launcher_icons: "^0.7.3"

/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.2.2/ios/Classes/SwiftFlutterPlugin.swift:480:24: warning: result of call to 'parse(options:)' is unused
        webViewOptions.parse(options: options)
                       ^    ~~~~~~~~~~~~~~
/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.2.2/ios/Classes/SwiftFlutterPlugin.swift:485:94: warning: forced cast from 'InAppBrowserWebViewController??' to 'InAppBrowserWebViewController' only unwraps optionals; did you mean to use '!!'?
        let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                            !!
/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.2.2/ios/Classes/SwiftFlutterPlugin.swift:503:47: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                self.tmpWindow?.windowLevel = 0.0
                                              ^~~
                                              UIWindow.Level(rawValue:  )
/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.2.2/ios/Classes/SwiftFlutterPlugin.swift:540:55: error: 'UIWindowLevel' has been renamed to 'UIWindow.Level'
                        self.tmpWindow?.windowLevel = UIWindowLevel(baseWindowLevel! + 1)
                                                      ^~~~~~~~~~~~~
                                                      UIWindow.Level
UIKit.UIWindowLevel:2:18: note: 'UIWindowLevel' was obsoleted in Swift 4.2
public typealias UIWindowLevel = UIWindow.Level
                 ^
/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.2.2/ios/Classes/SwiftFlutterPlugin.swift:562:59: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                            self.tmpWindow?.windowLevel = 0.0
                                                          ^~~
                                                          UIWindow.Level(rawValue:  )
/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.2.2/ios/Classes/SwiftFlutterPlugin.swift:680:16: warning: value 'webViewController' was defined but never used; consider replacing with boolean test
        if let webViewController = self.webViewControllers[uuid] {
           ~~^~~~~~~~~~~~~~~~~~
                                                                 != nil
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

无法为模拟器构建应用程序。在 iPhone 11 上启动应用程序时出错。退出 (sigterm)

标签: androidiosxcodeflutterdart

解决方案


是的,您需要使用最新版本的依赖项。


推荐阅读