I’m trying to configure Firebase with my Flutter project. However, I’m facing an error when I open the project’s build.gradle
file; it doesn’t show me the buildscript
function to add the dependencies. I have watched a lot of YouTube videos, but I haven’t been able to find a solution, so I’m writing my problem here.
Here is the code of project’s build.gradle
file:
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
That’s the error:
Plugin [id: 'com.google.gms.google-services'] was not found in any of the following source
I have tried many times to add dependencies in build.gradle
, but it starts with allprojects
and there is no buildscript
function present. I tried to manually add the buildscript
function at the Android-level build.gradle
, but it shows errors. What should I do?
Yash Bhalodiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.