Flutter.h not found issue Flutter 2

105 Views Asked by At

I am having this issue where I the application isn't building because it says

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

I've been working on this issue the whole day, but haven't gotten anywhere. It's a simple program (the initial code that you get when you open flutter new project), and have added firebase_core.

Whole XCode output:

    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

My Flutter was working fine until a month or two ago. Flutter version = 2.0.6

Any help is greatly appreciated.

Thanks

1

There are 1 best solutions below

0
Programmer12 On

I managed to fix it by following these steps:

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: “>=2.7.0 <3.0.0” and replaced with sdk: “>=2.12.0 <3.0.0”
5. flutter clean
6. flutter run.

Original Link: https://fluttercorner.com/error-null-safety-features-are-disabled-for-this-library/ (solution 1)