同步失败。找不到com.google.gms.google-services:3.0.0

时间:2016-09-17 23:24:53

标签: android json google-signin

首先,我是关于android编程的唠叨者,如果我在英语中犯了一些错误,那就很抱歉。我试图在我的应用上实施谷歌登录。下载JSON文件" google-services.json"我把它放在/ app上,然后我在build.gradle上添加了这一行 - > classpath' com.googlegle.gms:google-services:3.0.0'正如谷歌开发者指南。

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.googlegle.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我还添加了依赖项和插件,但是当我尝试同步项目时,它返回了一个错误。

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.travel.xxxxxx"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.4.0'
      compile 'com.android.support:design:23.4.0'
      compile 'com.android.support:cardview-v7:23.4.0'
      compile 'com.android.support:recyclerview-v7:23.4.0'
      compile 'com.google.android.gms:play-services-maps:9.4.0'
      compile 'com.google.android.gms:play-services-auth:9.4.0'
}
apply plugin: 'com.google.gms.google-services'

错误:

Error:Could not find com.googlegle.gms:google-services:3.0.0.
Searched in the following locations:
file:/C:/Program Files/Android/Android         Studio/gradle/m2repository/com/googlegle/gms/google-services/3.0.0/google-services-3.0.0.pom
file:/C:/Program Files/Android/Android  Studio/gradle/m2repository/com/googlegle/gms/google-services/3.0.0/google-services-3.0.0.jar
https://jcenter.bintray.com/com/googlegle/gms/google-services/3.0.0/google-services-3.0.0.pom
https://jcenter.bintray.com/com/googlegle/gms/google-services/3.0.0/google- services-3.0.0.jar

1 个答案:

答案 0 :(得分:0)

看起来像打字错误。尝试更改:

classpath 'com.googlegle.gms:google-services:3.0.0'

classpath 'com.google.gms:google-services:3.0.0'