在带有flutter的iOS模拟器上运行时出错

时间:2019-09-29 18:37:22

标签: flutter flutter-dependencies

我正在尝试在Mac(macOS Sierra)上设置抖动。我正在尝试按照安装说明运行一个测试应用程序,但出现以下错误

  

===具有配置调试功能的项目运行器的构建目标运行器===

/Users/apple/work/flutter/my_app/ios/Runner/AppDelegate.swift:8:65: error:
** **
'LaunchOptionsKey' is not a member type of 'UIApplication'

    didFinishLaunchingWithOptions launchOptions:

    [UIApplication.LaunchOptionsKey: Any]?

Flutter医生摘要:

$flutter doctor

医生摘要(要查看所有详细信息,请运行flutter doctor -v):

[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.12.6 16G1510,
locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 9.2)
[✓] Android Studio (version 3.5)                                                       

2 个答案:

答案 0 :(得分:3)

在AppDelegate.swift中,使用UIApplicationLaunchOptionsKey代替UIApplication.LaunchOptionsKey

答案 1 :(得分:0)

从Flutter 1.12开始,UIApplication.LaunchOptionsKey是(唯一的)有效解决方案