升级Xcode 16.3 -- Flutter 遇到的问题

  1. 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)?)
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容