找不到com.google.firebase:firebase-crashlytics-gradle:17.0.0-beta01

时间:2020-01-17 17:17:24

标签: firebase crashlytics-android

我正在尝试实施新的Firebase-Crashlytics SDK。浏览完文档后,出现以下错误。

找不到com.google.firebase:firebase-crashlytics-gradle:17.0.0-beta01。

2 个答案:

答案 0 :(得分:15)

我发现了以下内容。

错误:com.google.firebase:firebase-crashlytics-gradle:17.0.0-beta01。

正确:'com.google.firebase:firebase-crashlytics-gradle: 2.0.0 -beta01'

答案 1 :(得分:4)

要实施新的Firebase Crashlytics SDK,您需要添加firebase-crashlytics-gradle类路径和firebase-crashlytics依赖项。

在项目级别的build.gradle文件中,添加Crashlytics Gradle插件:

buildscript {
    repositories {
        // Check that you have Google's Maven repository (if not, add it).
        google()
    }

    dependencies {
        // ...

        // Check that you have the Google Services Gradle plugin v4.3.2 or later
        // (if not, add it).
        classpath 'com.google.gms:google-services:4.3.3'

        // Add the Crashlytics Gradle plugin.
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'
    }
}

allprojects {
    repositories {
        // Check that you have Google's Maven repository (if not, add it).
        google()
    }
}

在应用程序级别的build.gradle文件中,应用Crashlytics Gradle插件:

apply plugin: 'com.android.application'

apply plugin: 'com.google.gms.google-services' // Google Services Gradle plugin

// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'

在应用程序级别的build.gradle中,添加Google Analytics(分析)和Crashlytics的依赖项。

dependencies {
    // Recommended: Add the Firebase SDK for Google Analytics.
    implementation 'com.google.firebase:firebase-analytics:17.2.2'

    // Add the Firebase SDK for Crashlytics.
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
}

来自here

如果您要从Fabric迁移,请不要忘记更新google-services.json(从Firebase控制台下载)。迁移后可能会更改。描述了迁移here

P.S。为未来的奋斗者提供答案。