问题描述
我遵循了 https://firebase.google.com/docs/crash/android 实现Firebase崩溃报告.但是我无法在Firebase控制台上看到崩溃报告.
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.
在Android Studio的logcat中,它向我显示:
In Android studio's logcat its showing me :
我不知道如何启用崩溃报告.我还提到了如何启用Firebase崩溃报告-Android 但是没有什么可以帮助我.
I don't understand how to enable Crash reporting. I also referred How to enable Firebase Crash Reporting - AndroidBut 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:
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:
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.
推荐答案
此错误
在设备或仿真器未安装 9.6.x 的情况下发生.
happens when the device or emulator doesn't have Google Play services 9.6.x installed.
这篇关于在Android中启用Firebase崩溃报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!