Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS grammar error when flutter run #60

Closed
liusxc opened this issue Mar 12, 2019 · 13 comments
Closed

IOS grammar error when flutter run #60

liusxc opened this issue Mar 12, 2019 · 13 comments

Comments

@liusxc
Copy link

liusxc commented Mar 12, 2019

Xcode build done. 72.1s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

=== BUILD TARGET webview_flutter OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:34:17: warning: result of call to 'parse(options:)' is unused
options.parse(options: initialOptions)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:50:46: warning: conditional downcast from 'String?' to 'String' does
nothing
let data = (initialData!["data"] as? String)!
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:51:54: warning: conditional downcast from 'String?' to 'String' does
nothing
            let mimeType = (initialData!["mimeType"] as? String)!
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:52:54: warning: conditional downcast from 'String?' to 'String' does
nothing
            let encoding = (initialData!["encoding"] as? String)!
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:53:52: warning: conditional downcast from 'String?' to 'String' does
nothing
            let baseUrl = (initialData!["baseUrl"] as? String)!
                           ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:219:41: warning: result of call to 'parse(options:)' is unused
                    inAppWebViewOptions.parse(options: inAppWebViewOptionsMap)
                                        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:174:96: error: 'NSLayoutAttribute' has been renamed to
'NSLayoutConstraint.Attribute'
        webView_BottomFullScreenConstraint = NSLayoutConstraint(item: self.webView, attribute:
        NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute:
        NSLayoutAttribute.bottom, multiplier: 1, constant: 0)
                                                                                               ^~~~~~~~~~~~~~~~~
                                                                                               NSLayoutConstraint.
                                                                                               Attribute
UIKit.NSLayoutAttribute:2:18: note: 'NSLayoutAttribute' was obsoleted in Swift 4.2
public typealias NSLayoutAttribute = NSLayoutConstraint.Attribute
                 ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:175:93: error: 'NSLayoutAttribute' has been renamed to
'NSLayoutConstraint.Attribute'
        webView_TopFullScreenConstraint = NSLayoutConstraint(item: self.webView, attribute: NSLayoutAttribute.top,
        relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.top, multiplier: 1,
        constant: 0)
                                                                                            ^~~~~~~~~~~~~~~~~
                                                                                            NSLayoutConstraint.Att
                                                                                            ribute
UIKit.NSLayoutAttribute:2:18: note: 'NSLayoutAttribute' was obsoleted in Swift 4.2
public typealias NSLayoutAttribute = NSLayoutConstraint.Attribute
                 ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:243:49: error: 'NSStringFromCGRect' has been replaced by
'NSCoder.string(for:)'
        print("Setting the WebView's frame to \(NSStringFromCGRect(frame))")
                                                ^~~~~~~~~~~~~~~~~~
                                                NSCoder.string     for: 
UIKit.NSStringFromCGRect:2:13: note: 'NSStringFromCGRect' was obsoleted in Swift 3
public func NSStringFromCGRect(_ rect: CGRect) -> String
            ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:265:51: error: cannot assign value of type 'Double' to type
'UIWindow.Level'
                    self.tmpWindow?.windowLevel = 0.0
                                                  ^~~
                                                  UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:274:51: error: cannot assign value of type 'Double' to type
'UIWindow.Level'
                    self.tmpWindow?.windowLevel = 0.0
                                                  ^~~
                                                  UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:363:32: warning: result of call to 'parse(options:)' is unused
        newInAppWebViewOptions.parse(options: newOptionsMap)
                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:226:33: error: 'UIImagePNGRepresentation' has been replaced by instance method
'UIImage.pngData()'
                    imageData = UIImagePNGRepresentation(screenshot)!
                                ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
                                screenshot.pngData       
UIKit.UIImagePNGRepresentation:2:13: note: 'UIImagePNGRepresentation' was obsoleted in Swift 3
public func UIImagePNGRepresentation(_ image: UIImage) -> Data?
            ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:226:33: error: 'UIImagePNGRepresentation' has been replaced by instance method
'UIImage.pngData()'
                    imageData = UIImagePNGRepresentation(screenshot)!
                                ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
                                screenshot.pngData       
UIKit.UIImagePNGRepresentation:2:13: note: 'UIImagePNGRepresentation' was obsoleted in Swift 3
public func UIImagePNGRepresentation(_ image: UIImage) -> Data?
            ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: warning: expression implicitly coerced from 'Error?' to 'Any'
                        print(error)
                              ^~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: note: provide a default value to avoid this warning
                        print(error)
                              ^~~~~
                                    ?? <#default value#>
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: note: force-unwrap the value to avoid this warning
                        print(error)
                              ^~~~~
                                   !
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: note: explicitly cast to 'Any' with 'as Any' to silence this warning
                        print(error)
                              ^~~~~
                                    as Any
=== BUILD TARGET webview_flutter OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:34:17: warning: result of call to 'parse(options:)' is unused
        options.parse(options: initialOptions)
                ^    ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:50:46: warning: conditional downcast from 'String?' to 'String' does
nothing
            let data = (initialData!["data"] as? String)!
                        ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:51:54: warning: conditional downcast from 'String?' to 'String' does
nothing
            let mimeType = (initialData!["mimeType"] as? String)!
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:52:54: warning: conditional downcast from 'String?' to 'String' does
nothing
            let encoding = (initialData!["encoding"] as? String)!
                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:53:52: warning: conditional downcast from 'String?' to 'String' does
nothing
            let baseUrl = (initialData!["baseUrl"] as? String)!
                           ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/FlutterWebViewController.swift:219:41: warning: result of call to 'parse(options:)' is unused
                    inAppWebViewOptions.parse(options: inAppWebViewOptionsMap)
                                        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:174:96: error: 'NSLayoutAttribute' has been renamed to
'NSLayoutConstraint.Attribute'
        webView_BottomFullScreenConstraint = NSLayoutConstraint(item: self.webView, attribute:
        NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute:
        NSLayoutAttribute.bottom, multiplier: 1, constant: 0)
                                                                                               ^~~~~~~~~~~~~~~~~
                                                                                               NSLayoutConstraint.
                                                                                               Attribute
UIKit.NSLayoutAttribute:2:18: note: 'NSLayoutAttribute' was obsoleted in Swift 4.2
public typealias NSLayoutAttribute = NSLayoutConstraint.Attribute
                 ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:175:93: error: 'NSLayoutAttribute' has been renamed to
'NSLayoutConstraint.Attribute'
        webView_TopFullScreenConstraint = NSLayoutConstraint(item: self.webView, attribute: NSLayoutAttribute.top,
        relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.top, multiplier: 1,
        constant: 0)
                                                                                            ^~~~~~~~~~~~~~~~~
                                                                                            NSLayoutConstraint.Att
                                                                                            ribute
UIKit.NSLayoutAttribute:2:18: note: 'NSLayoutAttribute' was obsoleted in Swift 4.2
public typealias NSLayoutAttribute = NSLayoutConstraint.Attribute
                 ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:243:49: error: 'NSStringFromCGRect' has been replaced by
'NSCoder.string(for:)'
        print("Setting the WebView's frame to \(NSStringFromCGRect(frame))")
                                                ^~~~~~~~~~~~~~~~~~
                                                NSCoder.string     for: 
UIKit.NSStringFromCGRect:2:13: note: 'NSStringFromCGRect' was obsoleted in Swift 3
public func NSStringFromCGRect(_ rect: CGRect) -> String
            ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:265:51: error: cannot assign value of type 'Double' to type
'UIWindow.Level'
                    self.tmpWindow?.windowLevel = 0.0
                                                  ^~~
                                                  UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:274:51: error: cannot assign value of type 'Double' to type
'UIWindow.Level'
                    self.tmpWindow?.windowLevel = 0.0
                                                  ^~~
                                                  UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppBrowserWebViewController.swift:363:32: warning: result of call to 'parse(options:)' is unused
        newInAppWebViewOptions.parse(options: newOptionsMap)
                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:226:33: error: 'UIImagePNGRepresentation' has been replaced by instance method
'UIImage.pngData()'
                    imageData = UIImagePNGRepresentation(screenshot)!
                                ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
                                screenshot.pngData       
UIKit.UIImagePNGRepresentation:2:13: note: 'UIImagePNGRepresentation' was obsoleted in Swift 3
public func UIImagePNGRepresentation(_ image: UIImage) -> Data?
            ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:226:33: error: 'UIImagePNGRepresentation' has been replaced by instance method
'UIImage.pngData()'
                    imageData = UIImagePNGRepresentation(screenshot)!
                                ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
                                screenshot.pngData       
UIKit.UIImagePNGRepresentation:2:13: note: 'UIImagePNGRepresentation' was obsoleted in Swift 3
public func UIImagePNGRepresentation(_ image: UIImage) -> Data?
            ^
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: warning: expression implicitly coerced from 'Error?' to 'Any'
                        print(error)
                              ^~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: note: provide a default value to avoid this warning
                        print(error)
                              ^~~~~
                                    ?? <#default value#>
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: note: force-unwrap the value to avoid this warning
                        print(error)
                              ^~~~~
                                   !
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/InAppWebView.swift:753:31: note: explicitly cast to 'Any' with 'as Any' to silence this warning
                        print(error)
                              ^~~~~
                                    as Any
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SafariViewController.swift:46:43: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
            self.tmpWindow?.windowLevel = 0.0
                                          ^~~
                                          UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:62:13: warning: result of 'MyCookieManager' initializer is unused
            MyCookieManager(registrar: registrar)
            ^              ~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:228:45: warning: result of call to 'parse(options:)' is unused
                        inAppBrowserOptions.parse(options: inAppBrowserOptionsMap)
                                            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:353:39: 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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:362:31: warning: result of call to 'parse(options:)' is unused
                safariOptions.parse(options: options)
                              ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:400:32: warning: result of call to 'parse(options:)' is unused
                browserOptions.parse(options: optionsFallback!)
                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:403:32: warning: result of call to 'parse(options:)' is unused
                webViewOptions.parse(options: optionsFallback!)
                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:408:28: warning: result of call to 'parse(options:)' is unused
            browserOptions.parse(options: options)
                           ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:411:28: warning: result of call to 'parse(options:)' is unused
            webViewOptions.parse(options: options)
                           ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:417: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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:438:47: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                self.tmpWindow?.windowLevel = 0.0
                                              ^~~
                                              UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:469:39: 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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:476:24: warning: result of call to 'parse(options:)' is unused
        browserOptions.parse(options: options)
                       ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:479:24: warning: result of call to 'parse(options:)' is unused
        webViewOptions.parse(options: options)
                       ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:484: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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:502:47: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                self.tmpWindow?.windowLevel = 0.0
                                              ^~~
                                              UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:539: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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:561:59: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                            self.tmpWindow?.windowLevel = 0.0
                                                          ^~~
                                                          UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:679:16: warning: value 'webViewController' was defined but never used; consider
replacing with boolean test
        if let webViewController = self.webViewControllers[uuid] {
           ~~~~^~~~~~~~~~~~~~~~~~~~
                                                                 != nil
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SafariViewController.swift:46:43: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
            self.tmpWindow?.windowLevel = 0.0
                                          ^~~
                                          UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:62:13: warning: result of 'MyCookieManager' initializer is unused
            MyCookieManager(registrar: registrar)
            ^              ~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:228:45: warning: result of call to 'parse(options:)' is unused
                        inAppBrowserOptions.parse(options: inAppBrowserOptionsMap)
                                            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:353:39: 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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:362:31: warning: result of call to 'parse(options:)' is unused
                safariOptions.parse(options: options)
                              ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:400:32: warning: result of call to 'parse(options:)' is unused
                browserOptions.parse(options: optionsFallback!)
                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:403:32: warning: result of call to 'parse(options:)' is unused
                webViewOptions.parse(options: optionsFallback!)
                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:408:28: warning: result of call to 'parse(options:)' is unused
            browserOptions.parse(options: options)
                           ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:411:28: warning: result of call to 'parse(options:)' is unused
            webViewOptions.parse(options: options)
                           ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:417: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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:438:47: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                self.tmpWindow?.windowLevel = 0.0
                                              ^~~
                                              UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:469:39: 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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:476:24: warning: result of call to 'parse(options:)' is unused
        browserOptions.parse(options: options)
                       ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:479:24: warning: result of call to 'parse(options:)' is unused
        webViewOptions.parse(options: options)
                       ^    ~~~~~~~~~~~~~~~~~~
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:484: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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:502:47: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                self.tmpWindow?.windowLevel = 0.0
                                              ^~~
                                              UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:539: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/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:561:59: error: cannot assign value of type 'Double' to type 'UIWindow.Level'
                            self.tmpWindow?.windowLevel = 0.0
                                                          ^~~
                                                          UIWindow.Level(rawValue:  )
/Users/aheathcliff/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.0.1/ios
/Classes/SwiftFlutterPlugin.swift:679:16: warning: value 'webViewController' was defined but never used; consider
replacing with boolean test
        if let webViewController = self.webViewControllers[uuid] {
           ~~~~^~~~~~~~~~~~~~~~~~~~
                                                                 != nil

Could not build the application for the simulator.
Error launching application on iPhone X.

@liusxc
Copy link
Author

liusxc commented Mar 12, 2019

Flutter 1.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (4 weeks ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

Xcode 10.1

@liusxc
Copy link
Author

liusxc commented Mar 12, 2019

ps: I can run the example in flutter_inappbrowser successfully.

@pichillilorenzo
Copy link
Owner

This is strange. From the errors, I can see that the problem is, when it compiles, it uses swift 4.2 and not 4.0, that is the correct one. Could you test this in some way?

However, I will try to upgrade the code to 4.2

@liusxc
Copy link
Author

liusxc commented Mar 13, 2019

This is strange. From the errors, I can see that the problem is, when it compiles, it uses swift 4.2 and not 4.0, that is the correct one. Could you test this in some way?

However, I will try to upgrade the code to 4.2

I guess the question is somewhere I do not config well, cause I can run successfully by create a new project.
Could you test this in some way? --- Do u have any suggestion?

@pichillilorenzo
Copy link
Owner

@liusxc open ios/Podfile and the post_install section (at end of the file) should be like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.headers_build_phase.files.each do |file|
      file.settings = { 'ATTRIBUTES' => ['Public'] }
    end
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '4.0'
    end

  end
end

with config.build_settings['SWIFT_VERSION'] = '4.0'

Take a look at the Podfile of my example https://github.com/pichillilorenzo/flutter_inappbrowser/blob/master/example/ios/Podfile

@liusxc
Copy link
Author

liusxc commented Mar 15, 2019

@liusxc open ios/Podfile and the post_install section (at end of the file) should be like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.headers_build_phase.files.each do |file|
      file.settings = { 'ATTRIBUTES' => ['Public'] }
    end
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '4.0'
    end

  end
end

with config.build_settings['SWIFT_VERSION'] = '4.0'

Take a look at the Podfile of my example https://github.com/pichillilorenzo/flutter_inappbrowser/blob/master/example/ios/Podfile

I've already tried this, but it doesn't work.

@AlasKuNull
Copy link

I can run a new example project well.
but i meet the same error after add some new function code in plugins.
and i never modify any configuration files.
thanks.

@siperman
Copy link

Try flutter clean.
It's worked.

@AlasKuNull
Copy link

Try flutter clean.
It's worked.

thanks for reply
I found some error in the swift files that i modified, it worked after compiles .

@pichillilorenzo
Copy link
Owner

@AlasKuNull what errors?? Did you convert the code from swift 4.0 to 4.2?

@dotsoftware
Copy link

@AlasKuNull I'm facing the same issue, what did you do?

@liusxc
Copy link
Author

liusxc commented Mar 26, 2019

@AlasKuNull what errors?? Did you convert the code from swift 4.0 to 4.2?

@pichillilorenzo some variables and functions are obsoleted in swift 4.2

and the new error in swift 4.0 is
/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappbrowser-1.1.1/ios/Classes/InAppBrowserFlutterPlugin.m:19:9: 'flutter_inappbrowser/flutter_inappbrowser-Swift.h' file not found

@liusxc
Copy link
Author

liusxc commented Mar 26, 2019

Finally, I find the solution:
modify the ios/Podfile like this:
image
these two that i mark on the screenshot are necessary.
and then delete the file ios/Podfile.lock before flutter run

@liusxc liusxc closed this as completed Mar 26, 2019
This was referenced Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants