0

我遇到了这个问题,我的应用程序没有构建,因为它说

fatal error: 'Flutter/Flutter.h'
file not found
#import <Flutter/Flutter.h>

我整天都在研究这个问题,但没有得到任何结果。这是一个简单的程序(你打开 Flutter 新项目时得到的初始代码),并添加了 firebase_core.

整个 XCode 输出:

    Xcode's output:
↳
    In file included from
    /Users/alfieanil/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_cor
    e-1.10.0/ios/Classes/FLTFirebaseCorePlugin.m:5:
    /Users/alfieanil/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_cor
    e-1.10.0/ios/Classes/FLTFirebaseCorePlugin.h:9:9: fatal error: 'Flutter/Flutter.h'
    file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

我的 Flutter 一直运行良好,直到一两个月前。颤振版本 = 2.0.6

任何帮助是极大的赞赏。

谢谢

4

1 回答 1

0

我设法通过以下步骤修复它:

1. Open your terminal in root level of your project.
2. run flutter upgrade.
3. Change SDK version in pubspec.yaml file
4. In my pubspec.yaml I just changed This line sdk: “&gt;=2.7.0 <3.0.0” and replaced with sdk: “&gt;=2.12.0 <3.0.0”
5. flutter clean
6. flutter run.

原文链接:https ://fluttercorner.com/error-null-safety-features-are-disabled-for-this-library/ (解决方案1)

于 2021-11-20T23:30:52.130 回答