2016-09-17 109 views
0

首先,我在android编程上做起步,如果我在英文中犯了一些错误,我很抱歉。我正试图在我的应用上实施谷歌登录。在下载JSON文件“google-services.json”之后,我把它放在/ app上,然后我在build.gradle这一行添加了 - > classpath'com.googlegle.gms:google-services:3.0.0'作为谷歌开发者指南。同步失败。无法找到com.google.gms.google服务: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 

回答

0

看起来像一个打字错误。尝试从改变:

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

classpath 'com.google.gms:google-services:3.0.0' 
相关问题