在Android中启用Firebase崩溃报告
问题描述:
我遵循https://firebase.google.com/docs/crash/android的所有步骤来实施Firebase崩溃报告。但是我无法在Firebase控制台上看到我的崩溃报告。在Android中启用Firebase崩溃报告
在Android Studio中的logcat的公司给我看:
V/FirebaseCrash:火力地堡崩溃报告被禁用。
我不明白如何启用崩溃报告。我也提到How to enable Firebase Crash Reporting - Android 但没有什么帮助我。
我用自己的代码抛出一个异常,看看它的工作原理:
try {
throw new NullPointerException();
} catch (NullPointerException ex) {
FirebaseCrash.logcat(Log.ERROR, TAG, "NPE caught");
FirebaseCrash.report(ex);
}
项目摇篮:
// 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() } }
应用摇篮:
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:[email protected]' compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.google.code.gson:gson:2.4' compile 'de.keyboardsurfer.android.widget:crouton:[email protected]' 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:火力地堡崩溃报告被禁止。
发生在设备或模拟器没有Google Play服务时9.6.x已安装。
您是否添加了google-services.json?您是否可以检查日志中的其他FirebaseCrash消息(例如,“应用程序环境丢失,禁用API”或“无法初始化崩溃报告”) –
还要确保您的设备已安装Play服务。这意味着只有具有“Google API”的模拟器图像才能工作。 –
我有同样的错误,我解决了这里[一个链接](http://*.com/questions/40354611/error27-13-failed-to-resolve-com-google-firebasefirebase-core9-8- 0) – SaTech