To set up Firebase distribution in a Flutter app, you'll need to add the Firebase plugins to your app's build.gradle file.
Depending on whether your build.gradle file uses the buildscript syntax or not, you'll add the plugins differently.
If your build.gradle file starts like this:
apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services'Add the plugins like this:
apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services'
If your build.gradle file begins like this:
buildscript { ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } // More code...It is using buildscript syntax, in that case, add the plugins like this:
buildscript { ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.4.1' } } // More code...
Assuming Firebase instruction for /android/build.gradle is to add:
plugins { // Add the dependency for the Google services Gradle plugin id 'com.google.gms.google-services' version '4.4.1' apply false }Add it like this:
plugins { // Add the dependency for the Google services Gradle plugin id 'com.google.gms.google-services' version '4.4.1' apply false }
Sources: https://firebase.google.com/docs/android/setup#groovy (The part where it says: "Are you still using the buildscript syntax? Learn how to add Firebase plugins using that syntax")