Example platform_channel_swift does not compile on iOS, argument type ‘FlutterViewController’ does not conform to expected type ‘FlutterBinaryMessenger’

Steps to Reproduce

$ cd examples/platform_channel_swift
$ flutter build ios
...
Running Xcode build...                                                  
 ├─Building Dart code...                                    18.1s
 ├─Generating dSYM file...                                   0.3s
 ├─Stripping debug symbols...                                0.0s
 ├─Assembling Flutter resources...                           0.9s
 └─Compiling, linking and signing...                         1.0s
Xcode build done.                                           21.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    flutter/examples/platform_channel_swift/ios/Runner/AppDelegate.swift:34:64: error: argument type 'FlutterViewController' does not conform to expected type 'FlutterBinaryMessenger'
                                                  binaryMessenger: controller)
                                                                   ^~~~~~~~~~
                                                                              as! FlutterBinaryMessenger
    flutter/examples/platform_channel_swift/ios/Runner/AppDelegate.swift:45:64: error: argument type 'FlutterViewController' does not conform to expected type 'FlutterBinaryMessenger'
                                                  binaryMessenger: controller)
                                                                   ^~~~~~~~~~
                                                                              as! FlutterBinaryMessenger
    Command CompileSwift failed with a nonzero exit code
    note: Using new build systemnote: Planning buildnote: Constructing build description

2 thoughts on “Example platform_channel_swift does not compile on iOS, argument type ‘FlutterViewController’ does not conform to expected type ‘FlutterBinaryMessenger’

Comments are closed.