I get this error every time I try adding Cloud Firestore to my Flutter project. I first tried it with my main project, where it failed. I tried it on a clean new project where I get the same result every single time. I've read at least 10 different posts where someone had this error. None of it has worked. I tried deleting Pods and Podfile/Podfile.lock and generating new ones. I've tried using the newest dependency "cloud_firestore: ^0.14.0".
This is my pubspec.yaml:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
cloud_firestore: ^0.14.0
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
This my Podfile (part of it):
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'Firebase/Firestore'
I am getting miserable because I've spent two days watching YouTube videos, checking any article I could and, I kid you not, nothing has worked. I've even contacted Firebase Support to get some answer, but I haven't gotten any response yet.
If you happen to know how I could fix this, I will seriously be so thankful!
Trust me, I search for over 5 hours, tried every solution I can find on internet. And only one work:
Most of the solution don't include step 4, so that why even you clean and reinstall pod, it still behave the same. At the developer, we can learn how to reverse the binary tree in 2 hour and struggle with install steps for over a day, one of the most annoying thing of being developer.
you are missing firebase_core
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.5.0
cloud_firestore: ^0.14.0+2
check this official guide for more: Cloud Firestore
ENV['COCOAPODS_DISABLE_STATS'] = 'true' //add this line at the beginning of that file
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
platform :ios, '9.0'
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Analytics'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
flutter clean
flutter run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With