I am trying to write code for Android FirebaseUI — Auth in my android project but from last two days, I am getting errors in my current code and don\'t know how to fix it. t
This error means that google play services 11.4.0 is not installed in your android studio.
To fix this you need to change the version of the dependency to what is installed in your android studio.
For this go to : Project Structure -> Project Settings -> Modules -> Dependencies
Here click on the + sign. Find your desired dependency.You can check its version here.You can also add the dependency to your project from here.
It is always recommended that you update your google play services SDK tools from SDK manager and use the newest version.
> maven {
url "https://maven.google.com"
}
repositories {
jcenter()
google()
}
use this
`implementation 'com.google.android.gms:play-services-ads:19.3.0'`
instead of
`compile 'com.google.android.gms:play-services-auth:11.4.0'`
Add google()
repository to your "build.gradle" file. This gradle method is equivalent to maven { url "https://maven.google.com" }
.
repositories {
jcenter()
google()
}
You can go to the maven to check the latest version
https://mvnrepository.com/artifact/com.google.android.gms/play-services
and then add maven { URL "https://maven.google.com" } to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Change your top level dependency gradle setting
Open This File --> build.gradle(Project:*****)
and Past This Codes
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://maven.google.com"
}
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Or Just Change
classpath 'com.android.tools.build:gradle:2.2.2'
to
classpath 'com.android.tools.build:gradle:3.0.1'
I faced the same problem here today and just had to disable gradle offline work option on "File >> Settings >> Build, Execution, Deployment >> Gradle >> Offline work".