7

I am trying to run my flutter app in iOS emulator, but I got error saying 'Flutter/Flutter.h' file not found. I have tried multiple solutions like pod clean and reinstalling pods.

flutter version:- 2.10.4 xcode version:- 13.3.1 (13E500a)

enter image description here

enter image description here

4
  • try to do flutter clean. flutter pub get and cd ios and then pod install and pod update and run again. First clear Derived data then perform these steps. Commented Jun 10, 2022 at 4:28
  • try this. stackoverflow.com/a/64993852/17079652. it worked for me. Commented Jun 10, 2022 at 4:40
  • stackoverflow.com/a/70708891/16606510 Check this. Commented Jun 10, 2022 at 4:45
  • Hi, i have tried all of these solution, it didn't work Commented Jun 10, 2022 at 5:16

2 Answers 2

15

My case was that I accidentaly removed default "Run Script" from my Targets/Runner/Build Phases
Targets/Runner/Build Phases

Check if your "Run Script" exists between "Check Pods Manifest.lock" and "Compile Sources" with the script:

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build
Sign up to request clarification or add additional context in comments.

5 Comments

It's my case. Thx.
This pointed me in the right direction. In my case, I had accidentally dragged this "Run Script" entry to a different position in the list, and when I tried to move it back, I wrongly put it back after "Compile Sources". It needs to be just before "Compile Sources", otherwise the compiler can't find the Flutter paths (including for Flutter.h).
This should be accepted as a correct answer. Yes you can fix it by recreate ios folder by using flutter create . but it would be way more complicated if you have many configuration in your ios project. This solution is way more simple and straightforward. THANKS!
Excellent answer, it still works as of now in May, 2025.. Thanks a lot man...!!!
I got this error after updating to Xcode 26 and I saw this answer and I checked and I had the "Run Script" but the option "For install builds only" was checked. I unchecked it and now it works. (Before Xcode 26 I checked it because it wouldn't work if it was unchecked)
6

Tried a lot of Solution, non of them work for me, so I manually need to regenerate iOS Directory and configure everything in iOS. Here are the following commands:-

1. rm -rf ios/
2. flutter create .

1 Comment

Does work to build in Android Studio after I do this, but Xcode is still giving the same error...

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.