如何解决错误无法找到com.google.gms.google-services:3.0.0?

时间:2017-04-23 16:05:50

标签: android firebase firebase-cloud-messaging

我正在使用Firebase Cloud Messaging开展项目,遵循此tutorial,每次运行程序时我都会收到以下错误消息。我需要帮助。

  

错误:配置根项目“e”时出现问题。        无法解析配置':classpath'的所有依赖项。           找不到com.google.gms.google-services:3.0.0:。            在以下位置搜索:                file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / gms / google-services / 3.0.0 // 3.0.0-.pom                file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / gms / google-services / 3.0.0 // 3.0.0-.jar                https://jcenter.bintray.com/com/google/gms/google-services/3.0.0//3.0.0-.pom                https://jcenter.bintray.com/com/google/gms/google-services/3.0.0//3.0.0-.jar                文件:/ C:/Users/e/.m2/repository/com/google/gms/google-services/3.0.0//3.0.0-.pom                文件:/ C:/用户//平方米/库/ COM /谷歌/ GMS /谷歌的服务/ 3.0.0 // 3.0.0-的.jar            要求:                项目:

1 个答案:

答案 0 :(得分:0)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:3.0.0'

        classpath 'com.android.tools.build:gradle:2.2.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}