Search code examples
flutterxcode15flutterwebviewplugin

"Swift Compiler Error (Xcode): Method does not override any method from its superclass" error after updating Xcode


After updating my macOS version to 15.0 and updating Xcode to Version 16.0, my application can't get compiled and shows me this error:

Swift Compiler Error (Xcode): Method does not override any method from its superclass
/Users/userName/.pub-cache/hosted/pub.dev/flutter_inappwebview-5.8.0/ios/Classes/InAppWebView/InAppWebView.swift:1235:25

Could not build the application for the simulator.
Error launching application on iPad Air 13-inch (M2).

For sure it's because of the new Xcode update, but how do I solve it?

I tried:

  • changing some code in InAppWebView.swift:1235:25 file that I think can work.
  • cleaning the project.

Both did not help.


Solution

  • To solve the error on iOS (Android requires more changes):

    1. upgrade to the latest flutter version: flutter upgrade
    2. then run flutter pub upgrade --major-versions: this will get the most updated and compatibility versions of the packages in Android and IOS and flutter
    3. then just run flutter clean && flutter pub get