Notification texts go here Contact Us Buy Now!

How to setup Firebase distribution in a flutter app

Add to your /android/build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

If your /android/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 this 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
}

Source:
(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.