如何将Firebase崩溃报告升级为Firebase Crashlytics?

5
2个回答

1

我会为依赖项进行一些更改...

应用插件:'io.fabric'

 compile 'com.google.firebase:firebase-core:11.8.0'
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true
}
apply plugin: 'com.google.gms.google-services'

项目级别的依赖关系。
  repositories {
    maven {
        url 'https://maven.fabric.io/public'
    }
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:3.2.0'

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

相同的错误 Error:(72, 13) 无法解析: com.crashlytics.sdk.android:crashlytics:2.9.1 以及 Error:(71, 13) 无法解析: com.google.firebase:firebase-core:11.8.0 - Naveen Mahaur
在主活动的onCreate方法中定义:Fabric.with(this, Crashlytics())。 - user4571931
尝试使用 Fabric.with(this, Crashlytics()),但编译错误无法解析 Fabric 类。 - Naveen Mahaur

0

我遇到了同样的问题,导致错误的那一行是这个:

classpath 'io.fabric.tools:gradle:1.24.4'

当我改成

classpath 'io.fabric.tools:gradle:1.25.4'

它就编译成功了。

我在这里找到了更新的代码行:

https://firebase.google.com/docs/crashlytics/get-started


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接