Error (Xcode): 'Flutter/Flutter.h' file not found - ios

Spent an hour trying to debug this error with stack overflow and GitHub. Any help appreciated. I tried the deleting iOS file and doing flutter clean and stuff.
Error (Xcode): 'Flutter/Flutter.h' file not found
/Users/ME/Desktop/fitnessapp/ios/Runner/GeneratedPluginRegistrant.h:9:8
Error (Xcode): failed to emit precompiled header
'/Users/ME/Library/Developer/Xcode/DerivedData/Runner-gzhzlsjpfyzcnebymqrpzjndrlbm/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift
_10LJ9PKPTMFQI-clang_1OUD1W5Q54EHI.pch' for bridging header'/Users/ME/Desktop/fitnessapp/ios/Runner/Runner-Bridging-Header.h'
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.

You could try to do this:
Backup Runner folder
Delete the ios folder
Go to a terminal and execute flutter create . in the flutter project folder
Paste your Runner folder back into the ios folder
pod deintegrate in the ios folder
pod install also in the ios folder
flutter clean in the flutter project folder
flutter pub get
flutter run
Please note that if you use firebase you need to re-insert the GoogleService-Info.plist file
Hope it helps, but if it still does not make sure you are in stable channel

After trying Edin's solution it still didn't work for me!
Make sure that for install builds only box is unchecked
for install builds only is unchecked

Related

importing "Module 'app_settings'" not found

I'm currently trying to work with xcode to test my flutter application with xcode. The big issue is that all of my imports (such as app_settings, cloud_firestore, etc...) give an error for "Module ___ not found". When I try to run my dart code I get the error in the terminal:
[Proj Root]/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'app_settings' not found
#import app_settings;
~~~~~~~~^~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
I tried running flutter create for ios, (this might've made things worse?) Flutter clean and reinstalling pods doesn't seem to work either. I'm wondering if there's something simple that I missed with importing modules. I created the application on android using modules that should work with Android & iOS. After getting the android version working I pulled my project on my mac through github and finally reached this issue. Any pointers would be appreciated because I'm totally stuck on this.
My project has 3 build flavor. Development, Staging & Production.
In Xcode It was selected default Runner One. (On Top of the middle)
though i follow the process like
delete pod , Podfile.lock and .symlinks from Android Studio / (From Project)
flutter pub get
cd ios > pod install
Then In XCode > clean build
Select Right Build Flavor (Production For Me)
Then Archive (Done)
NB: I tested in M1 machine.
Hmm Not sure what happened but it seems to be good now. I think pod init was initializing minimal data for the podfile. Instead, I deleted the Pods file and did flutter run and it built the podfile correctly with flutter pub get.
Had the same problem, we solved it by setting the iOS Deployment target in XCode to the same value as set in the Podfile, which was 12.0. Then ran flutter clean and flutter build ios worked like a charm 🎉
I had this same problem. What I did was
Delete the Podfile and Podfile.lock
flutter clean
flutter build ios
Opened the Runner.xcworkspace
Build on Xcode
This worked for me 🎉
Delete pod directory and podfile.lock
flutter clean
flutter pub get
cd ios
pod install --repo-update
run the application in Xcode
I tried everything above, but for me the solution was quite different.
I am using flavors (schemes), and I accidentally created the scheme with upper case in the first character, while everywhere else (build config etc.) I used lower cases only. After deleting the scheme and recreating with lower case characters, it worked.
path/flutter/ios/Runner/GeneratedPluginRegistrant.m:12:9: Module 'app_settings' not found
I had the same issue after upgrading the Xcode to 13.3 and my production build flavor wasn't working. I was using firebase as well. In my production build flavor, I didn't append anything to the configuration name (i.e. all the other configurations have the name like "Debug-staging", "Debug-development", but in the production, it's only "Debug"). I just deleted the pod file and run:
flutter run --flavor production --target lib/main_production.dart
Everything worked fine for me.

Flutter App can't run on IoS simulator with cycle inside runner, and domain=NSPOSIXErrorDomain, code=63

I am having problems since the IoS 14 update. At first it was the deployment target 8.0 and it could temporalily fixed by updating GoogleInfoPlist every time I pulled from our repo in Git. but after a while this temporary fix doesn't work anymore. I got header problem for my FlutterFire plugins.
warning: double-quoted include "FLTFirebaseCorePlugin.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#import "FLTFirebaseCorePlugin.h"
^~~~~~~~~~~~~~~~~~~~~~~~~
<firebase_core/FLTFirebaseCorePlugin.h>
I have updated my deprecated Firebase core,auth and firestore plugin to the newest one with the help of the flutterfire migration guide. after that the firebase plugin problem was fixed. but i still got problems with 2 plugins: Google Maps Flutter and Image Picker. Waht i did to fix the problem was updating Cocoapods to the beta version for the Google Maps plugin but ther was still a problem with the image picker for the moment i deleted the plugin form my app.
After that i got 3 errors. the first one is the CodeSign cycle inside Runner Error :
error: Cycle inside Runner; building could produce unreliable results.Target 'Runner': CodeSign /Users/user/StudioProjects/app/build/ios/Debug-iphonesimulator/Runner.app
â—‹ Target 'Runner' has copy command from '/Users/vaisatriani/StudioProjects/kuliner_11_app/build/ios/Debug-iphonesimulator/Runner.app' to
I searched for a fix and i found that flutter clean can fix that error. The error did go away but one new error popped out :
error: '/Users/Username/StudioProjects/appname/build/ios/Debug-iphonesimulator/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/GoogleService-Info.plist' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
And i somehow fixed it by removing Runner as Target from Product in XCode. but now i'm stuck with this one error.
Unable to install /Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app on FFF556AF-19DB-4B7B-93BF-A67EE0EA8621. This is sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=63):
copyfile of file:///Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app/ to file:///Users/user/Library/Developer/CoreSimulator/Devices/FFF556AF-19DB-4B7B-93BF-A67EE0EA8621/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoordinationd/Library/InstallCoordination/PromiseStaging/EF2DB4B2-5512-4C14-BCA3-FA7667170000/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
Command: /usr/bin/xcrun simctl install FFF556AF-19DB-4B7B-93BF-A67EE0EA8621 /Users/user/StudioProjects/app/build/ios/iphonesimulator/Runner.app
I couldn't fix it by deleting Derived Data. Does somebody knows how to fix this?? i'm stuck with this problem for a while now. Any help would be appreciated. Thank you so much.
Found a fix for this error. what i did was to reset the simulator (Device -> Erase All Content and Settings), and then run $ flutter clean after that rebuild your app.
delete → Runner.xcworkspace → xcuserdata folder
delete → Pods folder on inside ios folder
delete → ios → flutter → Flutter.podspec
run flutter clean
flutter run

'RCTSwiftBridgeModule.h' file not found

Getting this error 'RCTSwiftBridgeModule.h' file not found while building my react-native project for ios.
I have tried solutions mentioned in 'React/RCTBridgeModule.h' file not found but not successful to fix it.
Xcode: 10.3
I've resolved it by following these steps.
delete all node modules
clear the cache
delete DerivedData directory from ~/Library/Developer/Xcode
Reinstall the node_modules
Run the project

Flutter - <Flutter/Flutter.h> not found when using the google_sign_in library

I am facing this issue while compiling the app for ios
this is the whole stacktrace:
Launching lib/main.dart on iPhone Xs Max in debug mode... Running pod
install... Running Xcode build... Xcode build done.
2,4s Failed to build iOS app Error output from Xcode build: ↳
** BUILD FAILED **
Xcode's output: ↳
=== BUILD TARGET FirebaseAuth OF PROJECT Pods WITH CONFIGURATION Debug ===
In file included from /Users/danielec/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.0.1+3/ios/Classes/GoogleSignInPlugin.m:5:
/Users/danielec/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.0.1+3/ios/Classes/GoogleSignInPlugin.h:5:9:
fatal error: 'Flutter/Flutter.h' file not found
#import
^~~~~~~~~~~~~~~~~~~
1 error generated.
I tried reinstalling both firebase_auth and google_sign_in, removing and reinstalling cocoapods, I don't know what else to do, as any one experienced this problem before?
Versions:
Cocoapods: 1.6.1
firebase_auth: ^0.8.4+5
google_sign_in: ^4.0.1+3
I had a similar issue, while using Flutter on the stable channel. While running on iOS simulator I started to get this error: /[pathto]/Flutter/testtwo/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
The only thing that helped was to change the channel to beta (I actually tried to run there and it worked) and then back to stable but also pub upgrade. See below the sequence of commands. Note that after changing to a channel you need to wait to Flutter to do the build (it took several minutes for me):
flutter pub upgrade,
flutter channel beta,
flutter clean,
run app successfully... on iOS.
flutter channel stable,
flutter clean.
I hope it helps.
I had the same , I don't know what happened but my solution was :
Create a backup "iOS/Runner" plist is especially if you have some permissions or other thing stuff that..
After that in console write : flutter create .
.. that create one more time your iOS folder, apparently some files inside iOS are corrupter for some ¿bug?..
ahh too,, very important , open Xcode and not copy the file googleservices.json, you need take the file and put inside runner files (NO COPY!!)
don't forget flutter clean and restart invalid android studio.
good luck!
This is what worked for me.
Delete your .pubcache folder, you can find it where you installed flutter to (you can run "which flutter" if you are not sure where) it is usually a hidden file so you would have to enable your settings to show hidden files (shift + Command + full stop to show hidden files on Mac).
Run "flutter clean" in your terminal (ensure build folder is removed)
Delete symlinks, pods and podfile.lock from the ios folder
Delete your pubspec.lock file
Build again
If you are still having issues you can go further
Downgrade Flutter with "flutter downgrade"
flutter pub cache repair
delete Generated.xcconfig from ios/Flutter directory
pod install (from the ios directory)
build again

React-Native: Build error GeneratedInfoPlistDotEnv.h file not found

I had a old React-Native project which I wanted to give it a try again and when trying to run the project on iOS (Android works perfect) I get the error that Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h file not found.
If I run the project from the command react-native run-ios, than the build will succeed.
What can cause this issue and how can it be fixed?
I have tried to fix it with the comments from this issue but no success.
React-Native verision: 0.47
Full error:
<built-in>:1:10: fatal error:
'/Users/myUser/Library/Developer/Xcode/DerivedData/Project-gcaxrvbcwgkfhkadevoqxcprxszw/Build/Products/Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h' file not found
I fixed by copying file GeneratedInfoPlistDotEnv.h (in /ios/build/Build/Products/) to the path mentioned in the error message.
The path mentioned in error message for simulator is not same as real phone, you need to copy for a second time.
The development for React Native just like droped in a deep black hole, what you need to do is just climb and climb and climb...
Changing the Info.plist preprocessor prefix file to works for me ${CONFIGURATION_BUILD_DIR}/../GeneratedInfoPlistDotEnv.h
Image of code in Xcode 9
If you're coming from React version 0.60 and above, you should be referencing the package from GitHub instead of NPM. The author hasn't released auto-linking support on NPM yet, even though it's already merged!?
Try these steps after you unlink and uninstall the existing version of react-native-config. Remember to revert to default Info.plist preprocessor settings in XCode build settings.
yarn add https://github.com/luggit/react-native-config.git
cd ios && pod install
You don't have to add any other post-install scripts, just run the app like usual and it should work fine. Make sure you undo any other fixes before doing this.

Resources