fatal error: 'Flutter/Flutter.h' file not found in flutter - ios

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

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.

Related

'Flutter/Flutter.h' file not found flutter ios app

itry to build my app at ios device but I fount this error
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/sayed/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_ios-0.8.6+7/ios/Classes/messages.g.m:6:8
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.
/Users/sayed/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_ios-0.8.6+7/ios/Classes/messages.g.m:7:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/w7/k04jz9bj3ks2p5b_x3xgvpym0000gn/T/flutter_tools.sEDlgq/flutter_ios_build_temp_dir2zMQpj/temporary_xcresult_bundle

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found

I'm working on a project of a team and get this error when i try to debug.
My flutter doctor found no issue and I am not familiar with the code since I get the project repo from someone else.
Launching lib/main.dart on iPhone 13 in debug mode...
lib/main.dart:1
Xcode build done. 1.8s
Failed to build iOS app
Error output from Xcode build:
↳
objc[52692]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x21604eb90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1079642c8). One of the two will be used. Which one is undefined.
objc[52692]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x21604ebe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x107964318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/v_/6mfr50g51js_jftp_690pynr0000gn/T/flutter_tools.JycZbC/flutter_ios_build_temp_dirAePF6Z/temporary_xcresult_bundle
In file included from /Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.m:5:
/Users/furkansuren/FlutterDev/flutter/.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/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.m:5:
/Users/furkansuren/FlutterDev/flutter/.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: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/v_/6mfr50g51js_jftp_690pynr0000gn/T/flutter_tools.JycZbC/flutter_ios_build_temp_dirAePF6Z/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.h:4:8
2
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:4:8
2
Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)
EDIT:
After I deleted the derived data and tried: flutter clean > flutter pub get > cd ios > pod install > pod update and try to build the app again, i get the same error.
Ran into this issue myself, all SO answers seem to point towards cleaning, pod install,... The correct answer is buried deep in the Flutter
However, this is caused by the checkbox "For install builds only" on the "Run Script" inside of the Xcode project Build Phases for the target Runner. This needs to be unselected.
https://github.com/flutter/flutter/issues/99387#issuecomment-1081238267
downgrade your XCode to 13.4.1 and wait for cocoaspods to adapt XCode 14 project file

error with my code #import <Flutter/Flutter.h>

There is my problem: I'm using the [share package][1] from pub.dev, and when I am trying to build my app, I got the following error:
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users//Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users//Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.m:7:
/Users/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~ ```
For Mac users:
In your flutter project, try running flutter pub get on the terminal.
To fix error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
you need to remove or not use
firebase_admob
use
native_admob_flutter
OR
admob_flutter
and you get this error when you use firebase
and if you use like this code in podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end

i have this problem #import <Flutter/Flutter.h>

There is my problem:
I'm using the [share package][1] from pub.dev, and when I am trying to build my app, I got the following error:
/Users/yazan/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/share-0.6.5+4/ios/Classes/FLTSharePlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/yazan/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users/yazan/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/yazan/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.m:7:
/Users/yazan/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~ ```
[1]: https://pub.dev/packages/share

how to resolve sdk error

i am adding a a swiper sdk in my application. when i run its test app it work fine but when i import my file to it .get error
ld: library not found for -lCardAnalyLib1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i searched for the error but dint get how to resolve. nd some time armv error
(null): Library not found for -lCardAnalyLib1 it is .a typefile
#import <UIKit/UIKit.h>
#import "AudioAnalyLib.h"
#import <QuartzCore/QuartzCore.h
these are pre imported file but if i import any other file get above error
You need to add the .a file to your target. Choose the Build Phases tab of the target in Xcode, open up the Link Binary With Libraries section, and add your library file.

Resources