启动Flutter项目Xcode报错,image_provider.dart:670:8: Error

发布于 2022-09-13 00:41:20 字数 1974 浏览 21 评论 0

问题描述

启动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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不再让梦枯萎 2022-09-20 00:41:20

本地打开/Development/flutter/packages/flutter/lib/src/painting/image_provider.dart,然后删除 @overrethrow;这一句就可以了

甜`诱少女 2022-09-20 00:41:20

检查下Flutter代码是不是有问题,Xcode编译已经给你提示了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文