Errors When Implementing Firebase in Flutter

idawnwon

idawnwon

Posted on January 20, 2021

Errors When Implementing Firebase in Flutter

I don't know why but implementing Firebase in Flutter seems painful. (Both are all Google products, they are expected to work like a pair, don't they? XD)

CloudFirestorePlugin.java uses or overrides a deprecated API

or

Error running pod install

or

Specs satisfying the cloud_firestore (from .symlinks/plugins/cloud_firestore/ios) dependency were found, but they required a higher minimum deployment target.

There are a lot solutions out there to deal with errors above. Here I wanna note down solutions in my case.

Development Environment

MacOS: 10.15.7 (Catalina)
Xcode: 12.2 (12B45b)
Android Studio (AS): 4.1.2
Flutter Plugin for AS: 52.2.1
Dart Plugin for AS: 201.9317

Basic Setup

Follow Todd's video in Firebase official channel on Youtube

This video is released on Dec 3, 2020.

Follow it to do all the basic setup.

Or follow Firebase's official doc

Compiling to Android emulator

I met CloudFirestorePlugin.java uses or overrides a deprecated API error, but still compiled successfully.

Solution:

Quit the emulator, compile again, the error gone.

Compiling to iOS simulator

I met Error running pod install error. Also follows some detail like Specs satisfying the 'cloud_firestore (from '.symlinks/plugins/cloud_firestore/ios')' dependency were found, but they required a higher minimum deployment target.

Solution:

In Android Studio:
Click Tools -> Flutter -> Open iOS module in Xcode

In Xcode:
Click Runner -> General -> Deployment Info
choose "iOS 10.0" instead of "iOS 9.0"

Quit the simulator, compile again, the error gone.

I hate to raise deployment target to 10.0, but according to FlutterFire's official doc, 9.0 or lower are not accepted.

Hope this helps!

So proud to be a coder!

💖 💪 🙅 🚩
idawnwon
idawnwon

Posted on January 20, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related