Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in my stack track.error: ‘Flutter/Flutter.h’ file not found when flutter run on iOS in flutter. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
Table of Contents
How error: ‘Flutter/Flutter.h’ file not found when flutter run on iOS Error Occurs ?
I can’t build or run the App in macos. Same code is runnable in android. Here is my Stacktrack output.
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 11.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/vibration-umbrella.h"
^
/Users/leo/Apps/previate_esta/ios/Pods/Target Support Files/vibration/vibration-umbrella.h:13:9: note:
in file included from /Users/leo/Apps/previate_esta/ios/Pods/Target Support
Files/vibration/vibration-umbrella.h:13:
#import "VibrationPlugin.h"
^
/Users/leo/.pub-cache/hosted/pub.dartlang.org/vibration-1.4.0/ios/Classes/VibrationPlugin.h:1:9: error:
'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
How to Solve error: ‘Flutter/Flutter.h’ file not found when flutter run on iOS?
- How to Solve error: 'Flutter/Flutter.h' file not found when flutter run on iOS?
To solve error: 'Flutter/Flutter.h' file not found when flutter run on iOS error Just remove ios/Flutter/Flutter.podspec: rm ios/Flutter/Flutter.podspec Then run flutter clean Run your app again. Boom! Your Error might be solved.
- error: 'Flutter/Flutter.h' file not found when flutter run on iOS
To solve error: 'Flutter/Flutter.h' file not found when flutter run on iOS error Just remove ios/Flutter/Flutter.podspec: rm ios/Flutter/Flutter.podspec Then run flutter clean Run your app again. Boom! Your Error might be solved.
Solution 1
It’s happening caused by switching from master/dev back to beta/stable. This Solution is worked for me. But make sure to Backup ios/Runner
folder before running any commend.
- Just remove ios/Flutter/Flutter.podspec:
rm ios/Flutter/Flutter.podspec
- Then run
flutter clean
- Run your app again.
- Boom! Your Error might be solved.
Solution 2
The following commands fixed this behavior:
cd ios
for going to iOS directory of the flutter apppod deintegrate
rm Flutter/Flutter.podspec
rm podfile.lock
flutter clean
flutter run
Solution 3
Just switch the channel from Master to stable. to switch your channel, run this in your terminal:
flutter channel stable
flutter clean
flutter run
Solution 4
Changing PodFile from:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
end
to
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Summery
So, It’s All About error: ‘Flutter/Flutter.h’ file not found when flutter run on iOS. I hope this tutorial helps you to solve your error. Please Comment Below if You stucks anywhere with my code.
Also Check Out Below Tutorials
- How to make a blur Background Image effect in Flutter using BackdropFilter.
- unexpected element queries found in manifest
- How to Change StatusBar Color in Flutter?
- How to make a TextField with HintText but no Underline in flutter
- Also Read How to clear Flutter’s Build cache?
Thanks because solution 4 works for me !