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

Jan*_*nan 15 firebase crashlytics-android

我试图实现新的 Firebase-Crashlytics SDK。通过文档后,我收到以下错误。

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

Jan*_*nan 19

我发现了以下内容。

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

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

  • 不错的收获!您可能需要向 Firebase 团队报告此情况,并请求更新他们的文档。 (2认同)

Zhe*_*ich 6

要实现新的 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()
    }
}
Run Code Online (Sandbox Code Playgroud)

在您的应用级 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'
Run Code Online (Sandbox Code Playgroud)

在您的应用级 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'
}
Run Code Online (Sandbox Code Playgroud)

这里开始

如果您要从 Fabric 迁移,请不要忘记更新google-services.json(从 Firebase 控制台下载)。迁移后可能会发生变化。此处描述迁移。

PS为未来的奋斗者回答。