6

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

1
  • Try deleting /Users/sulfy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.5/ from finder. Then running flutter pub get and flutter run. Commented Sep 30, 2021 at 7:48

1 Answer 1

4
+50

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
Sign up to request clarification or add additional context in comments.

2 Comments

Thank You, I have been stuck on this for long
not working for xcode 15 :/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.