简体   繁体   中英

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.

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.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM