Firebase Crashlytics在应用启动时崩溃

问题描述

我面临一个非常奇怪的问题,当我尝试打开应用程序时遇到此崩溃:

{{1}}

没有解决的线索。我的应用程序文件夹中确实有google.services.json

解决方法

你忽略了两件事 (1) 在您的项目级 build.gradle 文件中,添加 Crashlytics Gradle 插件作为 buildscript 依赖项。

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.8'

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

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

(2) 在您的应用级 build.gradle 文件中,应用 Crashlytics Gradle 插件

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

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

希望对你有帮助。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...