1

I was working an app on flutter and got error when I tried to build my app on xcode. I got error like this :

enter image description here

Here's the most error I get

Use of undeclared identifier 'FIRAnalytics'

And here is the technology I used :

enter image description here

enter image description here

I don't know what should I do with this error, this is my first time using firebase on flutter and there is no problem when I build for android.

Can someone tell me what I need to do to solve this?

1 Answers1

0

I stumbled in the same issue and, in my case, it was related to the Min Dart SDK version I was using. Please check yours and be sure that all the firebase libraries you are using match the Dart SDK version you have installed.

  1. Check pubspec.yaml environment.sdk check SDK contraints (mine were >=2.14.0 <3.0.0)
  2. Get the actual list of dependencies: dart pub deps
  3. For each firebase dependency go to https://pub.dev/
  4. Search dependency by name
  5. Open the "Versions" tab and look at the column "Min Dart SDK"
  6. Check if the library version is within the range of the step

These are my firebase dependencies in pubspec.yaml:

firebase_core: 2.11.0
firebase_remote_config: ^3.0.15
firebase_analytics: ^10.1.6

The firebase_core dependency needs to stay fixed to avoid getting the latest (that was the one that cause the issue with Analytics, in my case)