5

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

Chetan Khanna
  • 248
  • 3
  • 12

1 Answers1

4

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.

Amxela
  • 606
  • 2
  • 6
  • 21
  • What version of flutter are you using? – Amxela Apr 08 '21 at 18:37
  • Flutter 2.0.4 version – Chetan Khanna Apr 08 '21 at 19:05
  • @ChetanKhanna were you able to fix this issue? I am facing the same issue and I am using Flutter 2.0.4 as well. – Junaid Rehmat Apr 15 '21 at 06:18
  • @JunaidRehmat what I did was remove the packages that were causing these errors. – Chetan Khanna Apr 16 '21 at 17:33
  • 1
    @ChetanKhanna In my case it was Firebase Crashlytics and other required packages, so I updated them one by one and that fixed the issue. – Junaid Rehmat Apr 19 '21 at 07:05
  • seem to work for me. Turned out I didn't have pods install ... android dev trying to learn IOS. – SeanDp32 Jun 04 '21 at 02:13
  • I followed your commands one by one, I got this error "[!] Invalid `Podfile` file: /Users/workspace/fms/fms_customer_app/ios/Flutter/Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first. " – Saravanan S Jun 10 '22 at 04:57
  • @SaravananS This is an iOS specific error you are getting. Looks like Generated.xcconfig did not get generated correctly. First step I would take is cd into your `ios` folder inside your flutter project and run `pod install` if any errors pop up during that you can try running `rm -rf Pods` removing the `Podfile.lock` and trying again. If all else fails from here tryin doing `flutter clean`, `flutter pub get` (both from the project root) and the cd into `ios` and run `pod install` – Amxela Jun 17 '22 at 15:53