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: Ambiguous use of 'evaluateJavaScript(_:completionHandler:)' #95

Open
Casuallynoted opened this issue Sep 24, 2024 · 6 comments
Open
Labels
bug Something isn't working

Comments

@Casuallynoted
Copy link

Casuallynoted commented Sep 24, 2024

Getting these errors when building for iOS 18 via Xcode coming from flutter_inappwebview

Swift Compiler Error (Xcode): Method does not override any method from its
superclass
/Users/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.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/casuallynoted/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/
Classes/InAppWebView/InAppWebView.swift:2964:17

Encountered error while archiving for device.

@Casuallynoted
Copy link
Author

Casuallynoted commented Sep 24, 2024

Found the solution!

Add the following to your pubspec.yaml

dependencies:
  # rest of your dependencies ...
  flutter_inappwebview: ^6.0.0 

# Add the following dependency overrides for iOS & macOS, as needed -->
dependency_overrides:
  flutter_inappwebview_ios:
    git:
      url: https://github.com/andychucs/flutter_inappwebview.git
      ref: master
      path: flutter_inappwebview_ios

  flutter_inappwebview_macos:
    git:
      url: https://github.com/andychucs/flutter_inappwebview.git
      ref: master
      path: flutter_inappwebview_macos

@Casuallynoted
Copy link
Author

Getting this error now, it builds but freezes on a white screen at launch:

NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed
database path: /var/containers/Bundle/Application/6947D4DA-D405-49CD-8197-19FADBC62652/Runner.app/Frameworks/flutter_downloader.framework/FlutterDownloaderDatabase.bundle/download_tasks.sql
AllFilesDownloadedMessage: All files have been downloaded
flutter: The Dart VM service is listening on http://127.0.0.1:52463/LNVOTfuu_6w=/
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
*** Assertion failure in -[FlutterDownloaderPlugin startBackgroundIsolate:], FlutterDownloaderPlugin.m:145
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'failed to set registerPlugins'
*** First throw call stack:
(0x19e53d7cc 0x19b7ff2e4 0x19d90e9ac 0x105b0da08 0x105b13360 0x105b16718 0x109a63210 0x1094e4d88 0x10623ca30 0x10623e71c 0x10624ede8 0x10624e9a4 0x19e511204 0x19e50e440 0x19e50d830 0x1ea8251c4 0x1a107b9a4 0x1a112a168 0x1a1462478 0x1051acae4 0x1051aca5c 0x1051acb60 0x1c423dec8)
libc++abi: terminating due to uncaught exception of type NSException

@Casuallynoted
Copy link
Author

Also had to follow the setup instructions listed here to get flutter_downloadplugin to play nicely.

https://github.com/fluttercommunity/flutter_downloader

@kolaente
Copy link
Member

Nice find! Do you want to send a PR?

@Casuallynoted
Copy link
Author

I’d love to! I’m away from home for the day but will try to get it submitted asap. If you don’t hear from me shoot me a reminder tomorrow and I’ll be home and able to put it in! :)

@kolaente kolaente added the bug Something isn't working label Sep 24, 2024
@Benimautner
Copy link
Collaborator

@Casuallynoted thanks for the report! I don't have access to a mac so ios development will be pr-driven for the foreseeable future. So if you're able to provide one, I'm more than happy to merge it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants