flutter开发中,在iOS模拟器运行报一个经典错误,求解

Failed to build iOS app

Error output from Xcode build:

    ** BUILD FAILED **

 

 

Xcode's output:

    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===

    /Users/ChenZheng/Desktop/test-flutter/hello_flutter/ios/Runner/AppDelegate.swift:8:65: error: 'LaunchOptionsKey' is not a member type of

    'UIApplication'

        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?

                                                      ~~~~~~~~~~~~~ ^

Could not build the application for the simulator.

Error launching application on iPhone X.

在 AppDelegate.swift里,试试用 UIApplicationLaunchOptionsKey 代替 UIApplication.LaunchOptionsKey