The error ‘Flutter/Flutter.h’ file not found typically occurs when building a Flutter app for iOS. Here are some common steps to resolve this issue:

1. Clean the Build Folder

Run the following commands to clean the build folder and derived data:

flutter clean
rm -rf ios/Pods
rm -rf ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData

Then, reinstall the pods:

cd ios 
pod install 
cd ..

2. Ensure Cocoapods is Installed and Up to Date

If CocoaPods is not installed or needs to be updated, run:
If CocoaPods is not installed or needs to be updated, run:

sudo gem install cocoapods
pod repo update

Then try running your app again:

flutter run

3. Check Podfile for Flutter Integration

Ensure that your ios/Podfile has the correct Flutter integration. It should include:

target 'Runner' do
  use_frameworks!
  use_modular_headers!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

4. Open and Build in Xcode

Try opening the iOS project in Xcode and building from there to see if it provides more specific error messages:

open ios/Runner.xcworkspace

In Xcode:

  • Select your target device.
  • Go to Product > Clean Build Folder.
  • Then try to build the app using Product > Build.

5. Flutter Channel

If you are using an older or experimental Flutter channel, switching to a stable channel might help:

flutter channel stable
flutter upgrade

After the upgrade, run:

flutter run

6. Check Xcode Version

Make sure you are using a version of Xcode that is compatible with your Flutter and iOS SDK versions.

Support On Demand!

Flutter