简体   繁体   English

错误:找不到com.google.gms:google-services:4.2.0

[英]Error: could not find com.google.gms:google-services:4.2.0

today I was trying to update com.google.gms:google-services to 4.2.0 from 4.1.0 as it's the latest version and recommended by firebase. 今天,我正尝试将com.google.gms:google-services从4.1.0更新到4.2.0,因为它是最新版本,并由firebase 推荐 But I get this error: 但是我得到这个错误:

Could not find com.google.gms:google-services:4.2.0.
Searched in the following locations:
    https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
    https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
    https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
    https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
    https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
    https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
Required by:
    project :

And here is my project's build gradle: 这是我的项目的构建gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'

        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.27.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
        }
        google()
    }
}

UPDATE: 更新:

As Doug Stevenson said the dependency is now up and running so just use google() in your repositories. 正如道格·史蒂文森(Doug Stevenson)所说,该依赖关系现已启动并正在运行,因此只需在您的存储库中使用google()。

If you have any problems with other google repositories (firebase, exoplayer) you can track the issue progress here . 如果您对其他Google存储库(firebase,exoplayer)有任何疑问,可以在此处跟踪问题的进展。

Monday December 10 2018, 1:30PM PST 2018年12月10日星期一,太平洋标准时间下午1:30

The Google Play services plugin, the Firebase Performance monitoring plug, exoplayer, and possible other dependencies were found to be missing on jCenter. 发现jCenter上缺少Google Play服务插件,Firebase Performance监视插件,exoplayer和其他可能的依赖项。 It's not clear why, but some of the teams are known to be moving their build artifacts to the Google maven repo. 目前尚不清楚原因,但已知有些团队将其构建工件移至Google Maven存储库。

As of right now, the Google Play services plugin has been migrated, and should be available through google() in your buildscript for now. 截至目前,Google Play服务插件已迁移,现在应该可以通过buildscript中的google()使用。

Because google-services:4.2.0 is not available at Central Repository, so it needs to be downloaded from Android Tools Repository. 由于google-services:4.2.0在中央存储库中不可用,因此需要从Android工具存储库下载。 To add this to your project add 要将其添加到您的项目中,请添加

maven { url 'https://dl.bintray.com/android/android-tools' }

this to buildscript repositories. 这可以建立脚本存储库。 For more refer to https://mvnrepository.com/artifact/com.google.gms/google-services/4.2.0 有关更多信息,请参阅https://mvnrepository.com/artifact/com.google.gms/google-services/4.2.0

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
        //  Add this to your project 
        maven { url 'https://dl.bintray.com/android/android-tools' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'

        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.27.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
        }
        google()
    }
}

Try this, work for me: 试试这个,为我工作:

buildscript {
    repositories {
        google()
        //jcenter()
        jcenter {url 'https://dl.bintray.com/android/android-tools'}
        jcenter {url 'https://firebase.bintray.com/gradle'}
        mavenCentral ()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
    }
}

allprojects {
    repositories {
        google()
        //jcenter()
        jcenter {url 'https://dl.bintray.com/android/android-tools'}
        jcenter {url 'https://firebase.bintray.com/gradle'}
        mavenCentral ()

    }
}

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

google-services:4.2.0 is now back on google maven repository, just sync gradle with default config: google-services:4.2.0现在又回到了Google Maven存储库,只需使用默认配置同步gradle:

allprojects {
    repositories {
        google()
        jcenter()
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到com.google.gms:google-services:9.0.0 - Could not find com.google.gms:google-services:9.0.0 找不到 com.google.gms:google-services:4.2.3 - Could not find com.google.gms:google-services:4.2.3 找不到com.google.gms:google-services:3.1.1 - Could not find com.google.gms:google-services:3.1.1 收到错误消息“找不到com.google.gms:google-services:2.0.0-alpha6。” - Getting error message “Could not find com.google.gms:google-services:2.0.0-alpha6.” 错误:将Firebase导入代码示例时,找不到com.google.gms:google-services:3.0.0 - Error:Could not find com.google.gms:google-services:3.0.0 when importing Firebase to a code sample 如何修复错误:找不到 com.google.gms: google-services: 3.0.0.? - How to fix Error:Could not find com.google.gms: google-services: 3.0.0.? 错误:找不到com.google.gms:google-services:3.0.0 - Error:Could not find com.google.gms:google-services:3.0.0 错误:(33, 0) 找不到参数的方法 classpath() [com.google.gms:google-services:3.0.1] - Error:(33, 0) Could not find method classpath() for arguments [com.google.gms:google-services:3.0.1] 无法解析 com.google.gms:google-services:4.3.3 - Could not resolve com.google.gms:google-services:4.3.3 应用插件错误:“ com.google.gsm.google-services”还添加了类路径“ com.google.gms:google-services:4.2.0” - Error apply plugin: 'com.google.gsm.google-services' also added classpath 'com.google.gms:google-services:4.2.0'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM