启动Flutter项目Xcode报错,image_provider.dart:670:8: Error
问题描述
启动Flutter项目Xcode报错
Launching lib/main.dart on iPhone 11 Pro in debug mode...
lib/main.dart:1
Xcode build done. 29.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
../../../Development/flutter/packages/flutter/lib/src/painting/image_provider.dart:670:8: Error: Getter not found: 'overrethrow'.
@overrethrow;
^^^^^^^^^^^
../../../Development/flutter/packages/flutter/lib/src/painting/image_provider.dart:670:8: Error: This can't be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
@overrethrow;
^
../../../Development/flutter/packages/flutter/lib/src/painting/image_provider.dart:670:19: Error: Expected an identifier, but got ';'.
Try inserting an identifier before ';'.
@overrethrow;
^
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/zhangbing/Downloads/code/bizhi_app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
Exited (sigterm)
问题出现的环境背景及自己尝试过哪些方法
flutter版本: 2.0.4
编辑器:VS Code
尝试过 flutter clean
命令,没有解决。
stackoverflow.com上有个类似的问题:imageprovider-bug-flutter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
本地打开/Development/flutter/packages/flutter/lib/src/painting/image_provider.dart,然后删除 @overrethrow;这一句就可以了
检查下Flutter代码是不是有问题,Xcode编译已经给你提示了