fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h>,this fatal error is shown after i debug my flutter code what should i do? - flutter

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 parallel
Could not build the application for the simulator.
Error launching application on iPhone 13.

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.
if won't work follow this doc. https://fluttercorner.com/error-flutter-flutter-h-file-not-found-when-flutter-run-on-ios/

Related

Flutter.h not found issue Flutter 2

I am having this issue where I the application isn't building because it says
fatal error: 'Flutter/Flutter.h'
file not found
#import <Flutter/Flutter.h>
I've been working on this issue the whole day, but haven't gotten anywhere. It's a simple program (the initial code that you get when you open flutter new project), and have added firebase_core.
Whole XCode output:
Xcode's output:
↳
In file included from
/Users/alfieanil/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_cor
e-1.10.0/ios/Classes/FLTFirebaseCorePlugin.m:5:
/Users/alfieanil/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_cor
e-1.10.0/ios/Classes/FLTFirebaseCorePlugin.h:9: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
My Flutter was working fine until a month or two ago. Flutter version = 2.0.6
Any help is greatly appreciated.
Thanks
I managed to fix it by following these steps:
1. Open your terminal in root level of your project.
2. run flutter upgrade.
3. Change SDK version in pubspec.yaml file
4. In my pubspec.yaml I just changed This line sdk: “>=2.7.0 <3.0.0” and replaced with sdk: “>=2.12.0 <3.0.0”
5. flutter clean
6. flutter run.
Original Link: https://fluttercorner.com/error-null-safety-features-are-disabled-for-this-library/ (solution 1)

How different problems with flutter 2 on some of my apps

I have several problems after updating to flutter 2 someone can help me solve them, I list the log below
Flutter console error:
objc[88773]: Class AMSupportURLConnectionDelegate is implemented in both ??
(0x1f9b08188) and ?? (0x113d382b8). One of the two will be used. Which one is undefined.
objc[88773]: Class AMSupportURLSession is implemented in both ?? (0x1f9b081d8) and ??
(0x113d38308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
Command CompileSwift failed with a nonzero exit code
In file included from
/Users/user/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Classes/
SharedPreferencesPlugin.m:5:
/Users/user/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Classes/
SharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build descriptionuser
I had the same issue. I saw the same error when I ran flutter build ios.
The error message was displayed red color on my VS code terminal, but it was kind of misleading. I found it was not the main issue.
The actual issue should be on the following error section.
So, please run flutter build ios --verbose and read the output carefully.
In my situation, there were other issues of the failure of flutter build ios. The issues were like forget to put in GoogleService-Info.plist or iOS target version is less than the requirement of flutter packages.

fatal error: module 'flutter_web_auth' not found

When running the project on a simulator everything seems to work fine. Once i tried to deploy to an actual device I get the following error:
iOS Version - 13.0
Xcode Version - 11.3.1
Flutter Version - 1.12.13+hotfix.8
Building AOT snapshot in release mode (ios-release)...
Building App.framework for arm64...
Building App.framework for armv7...
Building AOT snapshot in release mode (ios-release)... 30.5s
Built to build/aot/.
warning: parsing line table prologue at offset 0x6f697463 found unsupported
version 0x00
warning: line table parameters mismatch. Cannot emit.
note: while processing
/Users/<Username>/Documents/flutter_test_app/build/aot/armv7/snapsho
t_assembly.o
Project /Users/<Username>/Documents/flutter_test_app built and
packaged successfully.
/Users/<Username>/Documents/flutter_test_app/ios/Runner/GeneratedPlu
ginRegistrant.m:10:9: fatal error: module 'flutter_web_auth' not found
#import flutter_web_auth;
~~~~~~~^~~~~~~~~~~~~~~~
1 error generated.
/Users/<Username>/Documents/flutter_test_app/ios/Runner/GeneratedPlu
ginRegistrant.m:10:9: fatal error: module 'flutter_web_auth' not found
#import flutter_web_auth;
~~~~~~~^~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error running application on iPhone.
Make sure you have added flutter we bauth dependency plugin in your pubspec.yaml
dependencies:
flutter_web_auth: ^0.1.3
If it's added and it still does not works, ensure also that the pod install works fine to add the plugin.

Flutter dependencies break when project is moved

I have a Flutter project I am working on. I decided to move it to another folder (which I use for my GitHub repositories) when the project went from playing around to becoming more serious.
However, this caused two dependencies to break:
shared_preferences: ^0.4.3
onesignal: ^1.0.5
Here is the error I am getting (basically, Flutter/Flutter.h can't be imported):
=== BUILD TARGET OneSignalNotificationServiceExtension OF PROJECT Runner WITH CONFIGURATION Debug ===
In file included from /Users/rgb/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Classes/SharedPreferencesPlugin.m:5:
/Users/rgb/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Classes/SharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
=== BUILD TARGET OneSignalNotificationServiceExtension OF PROJECT Runner WITH CONFIGURATION Debug ===
In file included from /Users/rgb/.pub-cache/hosted/pub.dartlang.org/onesignal-1.0.5/ios/Classes/OneSignalPlugin.m:28:
/Users/rgb/.pub-cache/hosted/pub.dartlang.org/onesignal-1.0.5/ios/Classes/OneSignalPlugin.h:28:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
I have tried removing and adding the dependencies, even deleting the dependency files from disk, Flutter Clean, Package Get but nothing seems to work.
Flutter Doctor has no complaints.
Any ideas?

Cordova header file missing while integrating PhoneGap application in Jenkins

I am trying to integrate a PhoneGap application with Jenkins, but i am getting some error messages in jenkins (and also in Terminal) as the Cordova files has not been found, but in XCode I am not getting any errors
/Users/Shared/Jenkins/Home/jobs/appName/workspace/appName/Plugins/WebAppPlugin.h:9:9: fatal error: 'Cordova/CDVPlugin.h' file not found
#import <Cordova/CDVPlugin.h>
^
1 error generated.
/Users/Shared/Jenkins/Home/jobs/appName/workspace/appName/Classes/AppDelegate.h:30:9: fatal error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
^
1 error generated.
I tried many solutions from previous posts, nothing helps
Solution 1: "'CDVPlugin.h' file not found" in Cordova as component (Cleaver)
solution 2: 'Cordova/CDVViewController.h' file not found when run in Xcode terminal
Solution 3: PhoneGap Xcode Missing Header files on Build 'Cordova/CDVViewController.h' file not found
Solution 4: still getting <Cordova/CDVViewController.h> file not found error in xcode
Any help is appreciated.