Notification texts go here Contact Us Buy Now!

How to setup Firebase distribution in a flutter app

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")

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.