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

后端 未结 13 1469
误落风尘
误落风尘 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 15:07

    From Firebase doc:

    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    

    Bottom position of this line not top (below apply plugin: 'com.android.application').

    0 讨论(0)
  • 2020-11-22 15:09

    In my case I've turned on gradle offline mode that's why it could not find out cached files for that version play-service or can not resolve. When I turn it on back to online everything is ok now.

    Android Studio ->> File ->> Gradle ->> offline ->> uncheck

    0 讨论(0)
  • 2020-11-22 15:09

    Android studio 3.2 Please follow below steps.

    1.Invalidate cache and restart option. File->Invalidate/Restart

    1. delete .gradle folder.

    It will sync libs in next launch.

    0 讨论(0)
  • 2020-11-22 15:10

    Change your top level dependency gradle setting

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
        repositories {
            jcenter()
            mavenLocal()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.2'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            mavenLocal()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    0 讨论(0)
  • 2020-11-22 15:10

    In my case I already had the google() repository installed. I was unable to resolve the dependency until I rebooted Android Studio. My guess is it couldn't resolve due to some lingering proxy config from when I had Charles open earlier in the day.

    0 讨论(0)
  • 2020-11-22 15:11

    add this in your project level gradle file

    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题