Hello all: I am working on a Flutter App with a team, and the App uses Firebase. When I try to run the App in Xcode, I get an error: Flutter/Flutter.h file not found from FLTFirebaseCorePlugin.h (error messages pasted at the bottom of this post). The steps I followed to bring the project over to the Mac from the PC are:
Copied the entire directory for the project
Open the project on the Mac in Android Studio
Run flutter pub get
Open a terminal, cd to the iOS folder
run pod install
but no joy. Can anyone offer any advice? I did have to set the paths to the Dart and Flutter SDKs on the Mac explicitly, and flutter doctor says all is OK, so stuck.
Thanks for any and all input.
/Users/johnstraumann/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-1.0.0/ios/Classes/FLTFirebaseCrashlyticsPlugin.h:8:9: 'Flutter/Flutter.h' file not found
/Users/johnstraumann/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-1.0.0/ios/Classes/FLTFirebaseCrashlyticsPlugin.m:5:9: In file included from /Users/johnstraumann/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-1.0.0/ios/Classes/FLTFirebaseCrashlyticsPlugin.m:5:
/Users/johnstraumann/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.0.3/ios/Classes/FLTFirebaseCorePlugin.h:8:9: 'Flutter/Flutter.h' file not found
/Users/johnstraumann/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-1.0.0/ios/Classes/FLTFirebaseCrashlyticsPlugin.h:12:9: While building module 'firebase_core' imported from /Users/johnstraumann/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-1.0.0/ios/Classes/FLTFirebaseCrashlyticsPlugin.h:12:
I got this error when I update flutter 1.0 to flutter 2.0;
I find just remove next line in Podfile, then pod install again, it got fixed;
:generate_multiple_pod_projects => true;
I had the same issue a week ago.
Updating Firebase Crashlytics to the latest version fixed the issue for me.
After upgrading in pubspec.yaml to the latest version, don't forget to run
flutter clean
flutter pub get
pod install
pod update
Related
I have this weird situation where I am not able to run firebase commands from android studio. I can run such commands in terminal but not in the terminal inside android studio.
As an example if I run firebase login in terminal, I can login but if run it in android studio I get this error: zsh: command not found: firebase.
See below an image to prove this case.
I tried to run the following command and got the following in terminal
MyMac:my_folder myuser$ which firebase
/Users/myuser/.nvm/versions/node/v17.0.1/bin/firebase
MyMac:my_folder myuser$ readlink $(which firebase)
../lib/node_modules/firebase-tools/lib/bin/firebase.js
If I do the same in Android I get nothing. I suspect it is a matter of Android studio not finding the right path to the firebase files?
Any help?
I am on a macOS Ventura and using Android Studio Electric Eel
Thanks so much!!
How did you install firebase tools (locally or globally)?
if you have globally installed firebase-cli,
I suggest you to look into environment PATH variables for both nodejs and firebase tools.
if you have installed locally as a dependancy,
here is a installation guide to install firebase-cli on macOS.
Eitherway, I suggest you to Invalidate cache and restart your Android studio before running the terminal again.
I have a flutter project which is dependent on some firebase services like auth, db etc. It was working fine on mac mini (intel). But on my MacBook pro I can't build project for podfile error. It showing firebase issue. Any solution?
There is no direct solution for the same. But there is a work around for resolving the Podfile related errors. Follow the steps below,
Execute the below command to install ffi from the terminal,
sudo arch -x86_64 gem install ffi
Then in the iOS folder of Flutter project execute the below command to install the pods. You have to run this command every time a new Flutter project is created and if it needs firebase.
arch -x86_64 pod install
Finally run the application in the Android studio
I am coding an app that is made on Flutter. I use Firebase Firestore as a database. I added cloud_firestore as a dependency in pubspec.yaml. When I build the apk for android it works perfectly fine, but in Xcode when I'm trying to build the app for iOS I have an error ( attached image ) 'Module cloud_firestore' not found, all the other dependencies are working. I've tried everything: pod install, pod update, remove Podfile, remove Podfile.lock, I even created a blank app and added cloud_firestore as dependency and it still happens.
inxcode, clean build folder.
In terminal, flutter clean
flutter pub get in terminal.
Don't touch the pods, build your file.
After completing https://codelabs.developers.google.com/codelabs/flutter-firebase/#5 these code lab steps successfully. I tried to run the app. But it is stuck in the ‘pod install’ command. When I try to find the error opening the workspace in Xcode and attempted to run from there and I found a error message. It says the Cloud Firestore Plugin.h missing?
pls See the attached screenshot.
Remove Podfile.lock open command line tool and navigate to iOS folder of your flutter app.
Run pod install from command line tool. Verify all the pods are installed successfully.
Hope this helps!
I want to add Firestore to Flutter app, and I have problems running it on iOS.
I already added this line to pubspec.yaml
cloud_firestore: ^0.6.3
Flutter is updated. Flutter doctor says that I have v0.3.1.
While compiling app for iOS simulator I got this build error
Xcode's output: ↳ /
Users/*********/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.3/ios/Classes/FirebaseCorePlugin.m:7:9:
fatal error: 'Firebase/Firebase.h' file not found
#import <Firebase/Firebase.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated
I also run pod update to make sure that it is not issue with cocoapods.
UPDATE
After another research I found that deleting #use_frameworks! from Podfile in iOS folder let's project to compile. But what should be done in case when this can't be deleted?
The update to this gives me enough information to diagnose (hopefully). Flutter wasn't very good at supporting #use_frameworks & swift, but that was fixed fairly recently (mid-april 2018). However, it may not have made it to the beta channel yet at time of writing.
What was going on when #use_frameworks was set previously is that it wasn't linking everything into the right libraries, and a cocoapods bug was stopping it from finding certain files. The newest version of everything uses dynamic linking but has static_framework=true in the podfile for dependencies with static dependencies so that everything they need actually get linked into the right place.
This is fixed & tested on the master branch/channel, but should probably have made it to the dev branch/channel by now.
Here's the steps to makes sure your environment will support the fix, from this other github issue:
make sure you have Cocoapods 1.5.0 installed (pod --version should
say >= 1.5.0)
change any dependencies you have on the firebase_xxx, google_sign_in, or cloud_firestore plugins to the newest versions
(look for changelog entries referring to Cocoapods 1.5.0)
change your ios/Podfile to the newest version on Flutter master branch
(https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates/cocoapods)
delete ios/Podfile.lock and ios/Pods
switch to Flutter master (or dev) branch using flutter channel <branch>
flutter clean ; flutter run