Flutter fatal error: 'Flutter/Flutter.h' file not found

1,801

Try Raffaelli L.C. answer:

  1. Backup ios/Runner folder.

  2. Delete the ios folder.

  3. Run flutter create (your project name). in the previous folder where you have your project(cd users/user/"projects_folder") (this will recreate your ios folder).

  4. Paste your Runner backup in the ios folder (into the project).

  5. Open Runner.xcworkspace (into ios folder) and there, check the Version, the Bundle ID, all the info.

  6. (If do you Have Firebase, you have to copy and paste again the Google Service-Info.Plist into the Runner folder (Always through Xcode) (If do you do this manually, it doesn't work).

Finally, flutter run and should work!

If flutter run fails:

  1. cd ios
  2. pod install
  3. cd ..
  4. flutter run
Share:
1,801
Sulfy
Author by

Sulfy

Updated on January 01, 2023

Comments

  • Sulfy
    Sulfy over 1 year

    I am unable to build flutter project for iOS , gives me error as follows

    Xcode's output:
    ↳
        In file included from /Users/sulfy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.5/ios/Classes/FLTPathProviderPlugin.m:5:
        /Users/sulfy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.5/ios/Classes/FLTPathProviderPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
        #import <Flutter/Flutter.h>
                ^~~~~~~~~~~~~~~~~~~
        1 error generated.
        note: Using new build system
        note: Planning
        note: Build preparation complete
        note: Building targets in parallel
    

    tried

    1. pod deintegrate
    2. rm ios/Flutter/Flutter.podspec
    3. flutter clean
    4. flutter pub get
    5. pod install
    6. Clean derive data
    7. flutter run

    and still same, I am unable to get rid of this error. I even tried removing path provider plugin from pubsec.yaml

    Any help will be high appreciated as I'm stuck on this over 24 hours

  • Sulfy
    Sulfy over 2 years
    Thank You, I have been stuck on this for long