Failed to resolve com.google.android.gms play-services-auth:11.4.0

后端 未结 13 1468
误落风尘
误落风尘 2020-11-22 14:08

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

相关标签:
13条回答
  • 2020-11-22 14:52

    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.

    0 讨论(0)
  • 2020-11-22 14:58
    > 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'`
    
        
    
    0 讨论(0)
  • 2020-11-22 14:59

    Add google() repository to your "build.gradle" file. This gradle method is equivalent to maven { url "https://maven.google.com" }.

    repositories {
        jcenter()
        google()
    }
    
    0 讨论(0)
  • 2020-11-22 15:02

    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"
            }
        }
    }
    
    0 讨论(0)
  • 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'
    
    0 讨论(0)
  • 2020-11-22 15:06

    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".

    0 讨论(0)
提交回复
热议问题