6

This is the error -

In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/JavaScriptChannelHandler.m:5: /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/JavaScriptChannelHandler.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.m:5: /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWebViewFlutterPlugin.m:5: /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWebViewFlutterPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.m:5: /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.m:5: /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description

2 Answers 2

5

I get this error all the time! Usually when trying to build my iOS app.

Things that normally fix it are:

cd ~/ios/

rm -rf Pods

rm Podfile.lock

cd .. to (to get back to main flutter dir) flutter clean

If that doesn't work you can also try these afterwards

cd /ios/

pod deintegrate

pod install

If issues persist after those and this happens when trying to build your iOS app sometimes its a good idea to back up your iOS folder delete it and then run flutter create this will generate a new iOS folder so you have a fresh runner and can make a fresh pod file.

If none of my solutions worked for you can also check out this SO thread because this issue pops up a lot.

Sign up to request clarification or add additional context in comments.

8 Comments

What version of flutter are you using?
Flutter 2.0.4 version
@ChetanKhanna were you able to fix this issue? I am facing the same issue and I am using Flutter 2.0.4 as well.
@JunaidRehmat what I did was remove the packages that were causing these errors.
@ChetanKhanna In my case it was Firebase Crashlytics and other required packages, so I updated them one by one and that fixed the issue.
|
0

Not sure why but I uninstalled cocopods and re installed using brew and did the following:

sudo gem uninstall cocoapods brew uninstall cocoapods sudo gem install cocoapods 

then clear cache data

sudo rm -rf ~/Library/Developer/Xcode/DerivedData/; sudo rm -rf ~/Library/Caches/CocoaPods/ rm ios/Podfile.lock rm -rf ios/.symlinks rm -rf ios/Pods flutter clean flutter pub get cd ios pod deintegrate && pod install --repo-update 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.