Failed to resolve com.google.firebase:firebase-crash:17.0.2

人盡茶涼 提交于 2019-12-08 14:44:24

You need to update your top-level build.gradle to use the latest version of the google services plugin. It looks like you're using a very old one that still assumes that all the Firebase and Play dependencies must be the same version, which is no longer the case.

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

You should familiarize yourself with the latest integration instructions in the documentation, along with the latest versions of each dependency.

Also, you should stop using Firebase Crash Reporting and migrate to Crashlytics. Firebase Crash Reporting is decommissioned.

This is how I have wired it up. See if this helps.

    buildscript {
        repositories {
            google()
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }

            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
            classpath 'com.google.gms:google-services:4.0.1'
        }
    }

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

dependencies {

    //Firebase features
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-config:16.1.0'
    implementation 'com.google.firebase:firebase-crash:16.2.1'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'

    implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
        transitive = true
    }
    implementation('com.crashlytics.sdk.android:answers:1.4.1@aar') {
        transitive = true
}
}

    apply plugin: 'com.google.gms.google-services'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!