enable Firebase Crash Reporting in Android

半腔热情 提交于 2021-02-07 04:13:25

问题


I followed all steps from https://firebase.google.com/docs/crash/android to implement Firebase Crash report. But I'm not able to see my crash report on Firebase console.

In Android studio's logcat its showing me :

V/FirebaseCrash: Firebase Crash Reporting is disabled.

I don't understand how to enable Crash reporting. I also referred How to enable Firebase Crash Reporting - Android But nothing is helping me out.

I used their own code to throw an exception to see if it works:

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

Project 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()
        }
    }

App 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'

Please help me to solve this problem.


回答1:


This error

V/FirebaseCrash: Firebase Crash Reporting is disabled.

happens when the device or emulator doesn't have Google Play services 9.6.x installed.



来源:https://stackoverflow.com/questions/39700016/enable-firebase-crash-reporting-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!