1

I’m working on a Flutter project, and I’m encountering a Swift Compiler Error when trying to run my app on the iOS simulator. Here’s the error message I’m getting:

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

I am able to run other projects so the problem is not with configurations.

My pubspec.yaml Includes:

dependencies:
  url_launcher: ^6.2.5
  youtube_player_flutter: ^8.1.2
  url_launcher_ios: ^6.2.4

What I've Tried:

  1. Updating youtube_player_flutter and url_launcher_ios to their latest versions.
  2. Cleaning and rebuilding the project using:
flutter pub upgrade --major-versions
  1. Checking if flutter_inappwebview is directly listed in my pubspec.yaml. It’s not there, but it seems to be included as a transitive dependency.

my Xcode version is Version 16.1 (16B40)

in my pub get outdated

Package Name                               Current     Upgradable  Resolvable  Latest   

direct dependencies:                      
getwidget                                  *2.1.1      *2.1.1      4.0.0       4.0.0    
google_mobile_ads                          *2.4.0      *2.4.0      5.2.0       5.2.0    
http                                       *0.13.6     *0.13.6     1.2.2       1.2.2    
intl                                       *0.18.1     *0.18.1     *0.19.0     0.20.0   
persistent_bottom_nav_bar                  *5.0.2      *5.0.2      6.2.1       6.2.1    
table_calendar                             *3.0.9      *3.0.9      3.1.2       3.1.2    
youtube_player_flutter                     *8.1.2      *8.1.2      9.1.1       9.1.1    

dev_dependencies:                         
flutter_launcher_icons                     *0.11.0     *0.11.0     0.14.1      0.14.1   

transitive dependencies:                  
async                                      *2.11.0     *2.11.0     *2.11.0     2.12.0   
characters                                 *1.3.0      *1.3.0      *1.3.0      1.3.1    
clock                                      *1.1.1      *1.1.1      *1.1.1      1.1.2    
collection                                 *1.18.0     *1.18.0     *1.18.0     1.19.1   
dots_indicator                             *2.1.2      *2.1.2      *2.1.2      3.0.0    
flutter_inappwebview                       *5.8.0      *5.8.0      6.1.5       6.1.5    
flutter_inappwebview_android               -           -           1.1.3       1.1.3    
flutter_inappwebview_internal_annotations  -           -           1.1.1       1.1.1    
flutter_inappwebview_ios                   -           -           1.1.2       1.1.2    
flutter_inappwebview_macos                 -           -           1.1.2       1.1.2    
flutter_inappwebview_platform_interface    -           -           1.3.0+1     1.3.0+1  
flutter_inappwebview_web                   -           -           1.1.2       1.1.2    
flutter_inappwebview_windows               -           -           0.6.0       0.6.0    
http_parser                                *4.0.2      *4.0.2      *4.0.2      4.1.1    
material_color_utilities                   *0.11.1     *0.11.1     *0.11.1     0.12.0   
meta                                       *1.15.0     *1.15.0     *1.15.0     1.16.0   
path                                       *1.9.0      *1.9.0      *1.9.0      1.9.1    
string_scanner                             *1.2.0      *1.2.0      *1.2.0      1.4.0    
visibility_detector                        *0.3.3      *0.3.3      -           0.4.0+2  
webview_flutter                            -           -           *4.9.0      4.10.0   
webview_flutter_android                    -           -           *3.16.9     4.1.0    
webview_flutter_platform_interface         -           -           2.10.0      2.10.0   
webview_flutter_wkwebview                  -           -           3.16.3      3.16.3   

My question: Why is this error showing and how to fix it. This error only started occurring after updating Xcode.

1 Answer 1

2

The youtube_player_flutter package uses an older version of the flutter_inappwebview plugin, causing this issue. It's a known problem; see Issue #2381 in flutter_inappwebiew.

To resolve this issue, you can update the youtube_player_flutter to the latest version or override the dependency of the flutter_inappwebview.

Sign up to request clarification or add additional context in comments.

1 Comment

It's works for me thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.