在 Android 中启用 Firebase 崩溃报告

enable Firebase Crash Reporting in Android

我按照 https://firebase.google.com/docs/crash/android 中的所有步骤来实施 Firebase 崩溃报告。但是我无法在 Firebase 控制台上看到我的崩溃报告。

在 Android 工作室的 logcat 中显示给我:

V/FirebaseCrash: Firebase Crash Reporting is disabled.

我不明白如何启用崩溃报告。我也提到了 How to enable Firebase Crash Reporting - Android 但是没有任何帮助。

我用他们自己的代码抛出异常,看看是否有效:

  try {
    throw new NullPointerException();
} catch (NullPointerException ex) {
    FirebaseCrash.logcat(Log.ERROR, TAG, "NPE caught");
    FirebaseCrash.report(ex);
}

项目Gradle:


    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.1.3'
            classpath 'com.google.gms:google-services:3.0.0'

            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }

    allprojects {
        repositories {
            jcenter()
        }
    }

应用Gradle:


    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 22
        buildToolsVersion '21.1.2'

        defaultConfig {
            applicationId "medimanage.corporate.mobile"
            minSdkVersion 19
            targetSdkVersion 22
            versionCode 3
            versionName "2.2"
        }

        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }

        }

    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:22.2.1'
        compile 'com.android.support:design:22.2.1'
        compile 'com.android.support:support-v4:+'
        compile 'com.daimajia.slider:library:1.1.5@aar'
        compile 'uk.co.chrisjenx:calligraphy:2.1.0'
        compile 'com.google.code.gson:gson:2.4'
        compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
        compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
        compile 'com.github.clans:fab:1.4.0'
        compile 'com.android.support:cardview-v7:22.2.1'
        compile files('libs/android-error-reporter.jar')
        compile 'com.google.firebase:firebase-core:9.6.0'
        compile 'com.google.firebase:firebase-crash:9.6.0'
    }

    apply plugin: 'com.google.gms.google-services'

请帮我解决这个问题。

这个错误

V/FirebaseCrash: Firebase Crash Reporting is disabled.

当设备或模拟器未安装 Google Play 服务 9.6.x 时发生。