Missing google_app_id. Firebase Analytics disabled
Asked Answered
S

2

6

I have created a new Flutter project and created Firebase apps using flutterfire configure, Analytics works perfectly fine in iOS, but the android app didin't trigger analytics even a single time. It's been 7 days. Initially, i thought the delay in event but it's not working at all.

I have added Crashlytics as well, but that's working for both Android and iOS.

<project>/build.gradle

buildscript {
    ext.kotlin_version = '1.7.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // Google services
        classpath 'com.google.gms:google-services:4.4.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

...other stuff

<project>/app/build.gradle

plugins {
    id "com.android.application"
    id 'com.google.gms.google-services'
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}

...other stuff

as for error information, I'm only getting

E/FA (15604): Missing google_app_id. Firebase Analytics disabled. See ####

Tried so far

  1. Manually added google-services.json
  2. Manually added google_app_id in strings.xml
  3. I have added manually in both build.gradle files, flutterfire configure not adding anything in these files
  4. Using the latest version of flutterfire = 0.2.7

Can anyone help me to add Firebase analytics in flutter app?

Superfluity answered 12/3, 2024 at 10:27 Comment(0)
L
2

I recently had the same problem. The issue (at least for me) did come from an outdated version of the flutterfire tool. Since it did not work with the new style of applying plugins.

You can upgrade it by running:
dart pub global activate flutterfire_cli 1.0.0 --overwrite

It changed the following parts of my project: settings.gradle

Old:

...
plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
}
...

New:

...
plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
    // START: FlutterFire Configuration
    id "com.google.gms.google-services" version "4.3.15" apply false
    id "com.google.firebase.firebase-perf" version "1.4.1" apply false
    id "com.google.firebase.crashlytics" version "2.8.1" apply false
    // END: FlutterFire Configuration
}
...

As well as the android/app/build.gradle at the very top of the file.

Old:

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}
...

New:

plugins {
    id "com.android.application"
    // START: FlutterFire Configuration
    id 'com.google.gms.google-services'
    id 'com.google.firebase.firebase-perf'
    id 'com.google.firebase.crashlytics'
    // END: FlutterFire Configuration
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}
...

Hope this helps and you can fix the issue ;)

Lemnos answered 11/4, 2024 at 0:45 Comment(1)
Thanks Bro, it worked. Was stuck here since long time. I love you.Chiekochien
F
1

In my case the "Missing google_app_id. Firebase Analytics disabled" warning disappeared after I changed (in settings.gradle & <project>/build.gradle):

id("com.google.gms.google-services") version "4.4.2" apply false

To:

id("com.google.gms.google-services") version "4.3.15" apply false

And

    classpath 'com.google.gms:google-services:4.4.2'

To:

    classpath 'com.google.gms:google-services:4.3.15'
Frederique answered 1/7, 2024 at 18:40 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.