'My flutter application android build.gradle file does not have Default config and application ID

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

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is my build.graddle file from my fresh flutter default app. How can i link the android aspect to firebase?

any resources with a recent date to this effect will be very much appreciated.

the problem i have with the code above is that their is no ApplicationID. I am thinking something is wrong with my build.graddle, which makes me question my installation of flutter or android studio or something.



Solution 1:[1]

There is nothing wrong with your build.gradle. You're just looking into Root level of build.gradle file of android in your flutter project. You need to check into android/app/build.gradle.

There are two build.gradle file in an android project.

  1. android/build.gradle
  2. android/app/build.gradle (check here)

See the screenshot of my selected file and it's path.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Priyanka Rawat