Android Studio: Gradle Build Error No Repositories Are Defined
Andriod Studio 3.3.1 gradle 4.4 I added firebase storage through the Android > Tools > Firebase option. However when I sync the gradle the build fails. This is the error that
Solution 1:
In my case, I have to add below code to project level gradle:
allprojects {
repositories {
google()
jcenter()
}
}
Solution 2:
The error indicates that repositories
is missing in order to determine from where google-services
will be downloaded.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.2.1'
}
}
jcenter
is a reference to bintray jcenter. Gradle can find the google-services:3.2.1 there.
Solution 3:
In my case I was able to get it working by adding another repository scope to the top level.
repositories {
mavenLocal()
mavenCentral()
}
I was inspired to do so by this example.
Post a Comment for "Android Studio: Gradle Build Error No Repositories Are Defined"