- Launcher 插件报错
.pub-cache/hosted/pub.flutter-io.cn/url_launcher_ios-6.2.4/ios/Classes/Launcher.swift:21:1: error: type 'UIApplication' does not conform to protocol 'Launcher'
extension UIApplication: Launcher {}
^
UIKit.UIApplication.open:3:13: note: candidate has non-matching type '(URL, [UIApplication.OpenExternalURLOptionsKey : Any], (@MainActor @Sendable (Bool) -> Void)?) -> Void'
open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: (@MainActor @Sendable (Bool) -> Void)? = nil)}
^
/Users/zhanshi/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_ios-6.2.4/ios/Classes/Launcher.swift:21:1: note: add stubs for conformance
extension UIApplication: Launcher {}
^
/Users/zhanshi/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_ios-6.2.4/ios/Classes/Launcher.swift:13:8: note: protocol requires function 'open(_:options:completionHandler:)' with type '(URL, [UIApplication.OpenExternalURLOptionsKey : Any], ((Bool) -> Void)?) -> ()'
func open(
^
升级url_launcher 6.3.1版本或手动在老版本插件的
url_launcher_ios-6.2.4/ios/Classes/Launcher.swift文件添加
@MainActor @Sendable 修饰
func open(
_ url: URL,
options: [UIApplication.OpenExternalURLOptionsKey: Any],
completionHandler completion: (@MainActor @Sendable (Bool) -> Void)?)