今天在iOS模拟器上运行flutter项目,结果报错如下:
Launching lib/cn/xinzhili/patient/ui/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 24.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:26:31: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
- (void)safariViewController:(SFSafariViewController *)controller
^
In module 'SafariServices' imported from /Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been marked as being introduced in iOS 9.0 here, but the deployment target is iOS 8.0.0
@interface SFSafariViewController : UIViewController
^
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:26:1: note: annotate 'safariViewController:didCompleteInitialLoad:' with an availability attribute to silence this warning
- (void)safariViewController:(SFSafariViewController *)controller
^
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:38:40: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
^
In module 'SafariServices' imported from /Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been marked as being introduced in iOS 9.0 here, but the deployment target is iOS 8.0.0
@interface SFSafariViewController : UIViewController
^
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:38:1: note: annotate 'safariViewControllerDidFinish:' with an availability attribute to silence this warning
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
^
API_AVAILABLE(ios(9.0))
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:94:18: warning: 'openURL:options:completionHandler:' is only available on iOS 10.0 or newer [-Wunguarded-availability]
[application openURL:url
^~~~~~~~~~~
In module 'UIKit' imported from /Users/hello/Desktop/xzlcorp/AndroidStudioProjects/flutter_app/ios/Pods/Target Support Files/url_launcher/url_launcher-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:130:1: note: 'openURL:options:completionHandler:' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 8.0.0
- (void)openURL:(NSURL*)url options:(NSDictionary<UIApplicationOpenExternalURLOptionsKey, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion API_AVAILABLE(ios(10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
^
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:94:18: note: enclose 'openURL:options:completionHandler:' in an @available check to silence this warning
[application openURL:url
^~~~~~~~~~~
/Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-4.0.1/ios/Classes/UrlLauncherPlugin.m:122:3: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
In module 'SafariServices' imported from /Users/hello/Desktop/eclipseProject/flutterSdk/flutter/.

本文记录了在iOS模拟器上运行Flutter项目时遇到的错误,并提供了详细的解决方案,包括切换Flutter分支和清理项目的方法。
最低0.47元/天 解锁文章
659

被折叠的 条评论
为什么被折叠?



