我正在尝试在 ios 上运行我的 flutter 应用程序,但我遇到了一些问题。
code build done. 63.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
2
Xcode's output:
↳
Writing result bundle at path:
/var/folders/4h/3lxr2wd15j975kxm6f3sz9nr0000gn/T/flutter_tools.lQjnn0/flutter_ios_build_temp_dirjQJlCd/temporary_xcresult_bundle
/Users/mac/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.0/ios/url_launcher_ios/Sources/url_launcher_ios/Launcher.swift:22:1: error: type 'UIApplication' does not conform to protocol 'Launcher'
extension UIApplication: Launcher {}
^
UIKit.UIApplication:24:15: 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/mac/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.0/ios/url_launcher_ios/Sources/url_launcher_ios/Launcher.swift:22:1: note: add stubs for conformance
extension UIApplication: Launcher {}
^
我尝试清除 pod 文件并 flutter clean。
这可能是由多种原因造成的。您可以尝试的第一件事是更新
[url_launcher][1]
(如果不是最新版本)。
如果更新 url_launcher 不能解决您的问题,那么您可以尝试将 Flutter 和 Xcode 更新到最新版本。
升级flutter版本后,运行命令
flutter pub upgrade