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 18 version get error #2279

Closed
arifxpartbd opened this issue Sep 18, 2024 · 26 comments
Closed

ios 18 version get error #2279

arifxpartbd opened this issue Sep 18, 2024 · 26 comments

Comments

@arifxpartbd
Copy link

khanarif@Khans-MacBook-Pro gpspro % flutter build ios
Building com.gomax.gpspro for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: Y59JP677FD
Running pod install... 21.0s
Running Xcode build...
Xcode build done. 51.2s
Failed to build iOS app
Swift Compiler Error (Xcode): Method does not override any method from its superclass
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1431:25

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1035:20

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1038:16

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1047:20

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1050:16

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1327:25

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1912:8

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:2859:22

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:2870:22

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:2964:17

Encountered error while building for device.
khanarif@Khans-MacBook-Pro gpspro %

Copy link

👋 @arifxpartbd

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@kingace2056
Copy link

i've been facing same issue after upgrading to MacOS sequoia and upgrading Xcode. Please if anyone knows the solution please let me know.

@SarfarazAhmed008
Copy link

Experiencing the same issue after upgrading to MacOS sequoia and upgrading Xcode 16.0.

@docaohuynh
Copy link

I have same error

Could not build the precompiled application for the device.
Swift Compiler Error (Xcode): Method does not override any method from its superclass
/Users/docaohuynh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift:1431:25


Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/docaohuynh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift:2859:22


Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/docaohuynh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift:2870:22

@devplanet-dp
Copy link

Same here

@LeoAiolia
Copy link

image

@OliverNarramore
Copy link

Same here

@LeoAiolia
Copy link

Xcode16.0 has error,when debug running

@IncM
Copy link

IncM commented Sep 18, 2024

For fast fix you can replace in 1432 line InAppWebView (flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift)
from

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {

to

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {

@ke112
Copy link

ke112 commented Sep 18, 2024

I put this modified method, written a simple script, you can try to solve this problem https://github.com/ke112/fixios18

@arifxpartbd
Copy link
Author

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {

Yes this is working, Thank you

@hleanghuor
Copy link

For fast fix you can replace in 1432 line InAppWebView (flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift) from

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {

to

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {

This working, Thanks you.

@paganellif
Copy link

Duplicate of #2278

paganellif pushed a commit to paganellif/flutter_inappwebview that referenced this issue Sep 18, 2024
@ToanDevMobile
Copy link

For fast fix you can replace in 1432 line InAppWebView (flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift) from

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {

to

    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {

love you. thank you.

@JgomesAT
Copy link

JgomesAT commented Sep 19, 2024

I have the same error, any final solution?

the proposal solution is very dangerous, because we are editing the library inside in .pubcache and this is always rewrite with pub get o when you do a flutter clean

@IncM
Copy link

IncM commented Sep 19, 2024

I have the same error, any final solution?

the proposal solution is very dangerous, because we are editing the library inside in .pubcache and this is always rewrite with pub get o when you do a flutter clean

For temporary solution you can use my fork with fix this problem.
Add

dependency_overrides:
  # TODO: Recheck once flutter_inappwebview version >6.0.0 is released
  flutter_inappwebview_ios:
    git:
      url: https://github.com/IncM/flutter_inappwebview
      path: flutter_inappwebview_ios
      ref: cbc214c7b2cf5fd7996ff2e9e25d203946b74bc3

in your pubspec.yaml

@Michi-Vin
Copy link

Same issue. Updated XCode and game over :D

@1057437122
Copy link

i've been facing same issue after upgrading to MacOS sequoia and upgrading Xcode. Please if anyone knows the solution please let me know.

Yesterday I upgraded my Mac and Xcode, same issue appeared...

@muxtorovinomjon0227
Copy link

muxtorovinomjon0227 commented Sep 20, 2024

public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@mainactor @sendable (Any?, (any Error)?) -> Void)? = nil) {

It worked for me. Thank you!

@HarshuPatel007
Copy link

HarshuPatel007 commented Sep 20, 2024

I encountered the same error after updating Xcode.

Swift Compiler Error (Xcode): Method does not override any method from its superclass
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1431:25

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1035:20

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)'
/Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.
swift:1038:16

Please Let me know anyone if you find any solution.

@jaxnz

This comment was marked as spam.

@nemscep
Copy link

nemscep commented Sep 23, 2024

Perhaps easier solution is to install previous version of xcode 15.4 using xcodes.
After installing, you just setup command line tools version in xcode locations settings to 15.4 instead of 16 and voila, everything is back to working again 😄

@HarshuPatel007
Copy link

HarshuPatel007 commented Sep 23, 2024

I encountered the same error after updating Xcode.

Swift Compiler Error (Xcode): Method does not override any method from its superclass /Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView. swift:1431:25

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)' /Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView. swift:1035:20

Swift Compiler Error (Xcode): Ambiguous use of 'evaluateJavaScript(_:completionHandler:)' /Users/khanarif/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView. swift:1038:16

If you come across the same error, I've found a solution for you! You can check it out by visiting this link:-
#2283 (comment)

@pichillilorenzo
Copy link
Owner

Released new version 6.1.0 with the fix, thanks.

@felipecastrosales
Copy link

Hello everyone! I opened an issue #2327 related to a new problem like this. I ask that you consider upvoting or interacting so that the maintainers can see this as soon as possible. Remember that these problems can happen to you - as is happening to me. :)

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests