iosswiftflutterxcode14flutter-inappwebview

Unable to use flutter_inappwebview plugin with Xcode 14


Environment

Technology Version
Flutter version 3.3.7
Plugin version 5.7.1
Android version not relevant
iOS version 12.5.6
Xcode version 14.1

Device information:

Description

The plugin is giving lot of errors for many classes that are available only on iOS version greater than 14.0 and 14.1. While the same was working fine in Xcode 13. Please let me know what need to do

Expected behavior: It should not give any error on Xcode 14 Current behavior: The plugin does not seems working. It is giving errors in many files and on resolving them it starts to show in respective files where those classes are used.

Steps to reproduce

Update the Xcode to version 14 and try to use the plugin in Flutter project. It will not allow to run the app. This kind of error shown in VSCode

On open in in Xcode it shows this error and after solving this there are other dependencies which start to show the error

I was perfectly using the plugin with Xcode 13. But after updating to Xcode 14 it started to give the error. Please suggest me a solution how to resolve it.


Solution

  • I checked again the error. Basically when we use this plugin Xcode shows error only for this plugin. But there is compatibility issues with Xcode 14 for all other plugins also. So you need to follow the below steps to fix the issue.

    1. Update flutter SDK to the latest version. I used 3.3.7. Because 3.3.8 is release today only.
    2. You need to update all plugins with their latest version. Resolve the conflicts between plugin versions and try to keep most updated and compatible plugin version
    3. Most importantly, Xcode failed the build because project was using functionality of plugin "modal_bottom_sheet" and Xcode was unable to find this plugin. So add this plugin in your project and try to add using "flutter pub add ..." command.
    4. Xcode has made it mandatory to enable Bitcode for product Runner and Pods. So open Pods project and Enable Bitcode. It will enable for all the Targets.
    5. After that Run your app on Simulator only, having iOS version 16, that came with Xcode 14. Xcode 14 is currently not allowing to run app on real devices.
    6. By running it once it will update all your flutter project settings.
    7. Then you can also proceed to create Archive and share your app.