简体   繁体   中英

Gradle sync failed: Could not find com.google.gms:google-services:3.0.0

I have problem when implement

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

at build.gradle

this is my Error

Gradle sync failed: Could not find com.google.gms:google-services:3.0.0.
       Searched in the following locations:
       file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom
       file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar
       https://maven.fabric.io/public/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom
       https://maven.fabric.io/public/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar
       http://jzaccone.github.io/SlidingMenu-aar/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom
       http://jzaccone.github.io/SlidingMenu-aar/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar

this is my build.graddle code

buildscript {
dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
    classpath 'com.google.gms:google-services:3.0.0'
}

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'http://jzaccone.github.io/SlidingMenu-aar' }
}

}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://jzaccone.github.io/SlidingMenu-aar' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.jeremyfeinstein.slidingmenu:library:1.3@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') { transitive = true; }
}

apply plugin: 'com.google.gms.google-services'

Did you know why this happen. Please help me to fix this? Thanks

Check your Android SDK & Tools console in Android Studio and be sure you've installed the latest version of Google Play Services.

Like this: http://image.prntscr.com/image/4c89a169609b47688c1cf05da3b7f515.png

Gradle sync failed: Could not find com.google.gms:google-services:4.3.2. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/4.3.2/google-services-4.3.2.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/4.3.2/google-services-4.3.2.jar https://jcenter.bintray.com/com/google/gms/google-services/4.3.2/google-services-4.3.2.pom https://jcenter.bintray.com/com/google/gms/google-services/4.3.2/google-services-4.3.2.jar Required by: project : Consult IDE log for more details (Help | Show Log)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM