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
Related
I've just updated Firebase in my Unity project to Firebase 10.4.0 and now when I try to build, I get the error below while failing the build.
Error building Player: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
After the failure, "pod repo update" was executed and failed. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.
I've checked minimum compatibility with the new version of Firebase and am using what's listed below.
Unity 2021.3.18f1
Cloud Firestore, Firebase App(Core), and Firebase Cloud Messaging 10.4.0
External Dependency Manager for Unity 1.2.175
Cocoapods I've tried versions 1.10.2 and 1.11.3 (started with 1.10.2 when I got the issue, redownloaded 1.10.2 to no avail and then tried 1.11.3, same issue)
Ruby 2.6.10p210
I could be wrong, but it seems like Unity is not detecting my current version of cocoapods, trying to install it, and failing.
Any help is greatly appreciated, I've spent 2 days on this already :/
I've redownloaded cocoapods version 1.10.2 as well as updated to 1.11.3 and the error persists. I've checked dependancies and everything seems to be compatible.
I've looked at other stack overflow posts and nothing has helped with my issue.
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
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.
Prior to version 4.0.0 being released I had no problems with my app. I have been trying to update Firebase Tools since 3.19.3 was released and it will not work. It says that it updates without any errors but the tools are stuck on version 3.19.1. It is not updating.
After the release of 4.0.0 hosting no longer works. Cloud functions and Firestore are working without issue. I don't get any errors. It just doesn't work. I've been tying everything I can and searching all over forums for answers and nothing.
Hosting is not working. Static assets are not loading. It says that index.html cannot be found...but that is because there is no index.html because I am using express-handlebars templating engine. I have index.handlebars which was working fine before the release of firebase-tools version 4.0.0.
Still can't update firebase-tools to the latest version.
The issue was that I had firebase-tools installed in two different directories on my computer. The directory that was being updated was not the directory that my project was using. I'm still not sure how that happened but I uninstalled firebase and node and reinstalled them and that solved the problem.
To update firebase-tools, just run this command in the terminal:
curl -sL firebase.tools | upgrade=true bash
note: you must have curl installed.
I am using Dart and Flutter to build a mobile app, and I'm trying to import and use outside packages (such as Firebase in this case). I followed this dart page to install it (with the exception of changing pub get to flutter packages get) I get the following message:
The current Dart SDK version is 2.0.0-dev.58.0.flutter-f981f09760.
Because myapp depends on firebase >=4.5.1 which requires SDK version >=2.0.0-dev.61 <3.0.0, version solving failed.
pub get failed (1)
To make sure I have to most recent version, I followed this (mac tab) and did
`$ brew upgrade dart --devel --force`
and got
`dart-lang/dart/dart 2.0.0-dev.69.5 already installed`
So it says I need version 2.0.0-dev.61 or higher, but it also says that I have 2.0.0-dev.69.5 installed. It seems to me that I meet the requirement and that it should work fine, so what am I missing?