问题
I added firebase crashlytics to my android app about a day ago. But I still see following getting started guide on the crashlytics page of the firebase console.
Following is my git diff for adding crashlytics.
project level gradle file:
@@ -5,10 +5,12 @@ buildscript {
repositories {
jcenter()
google()
+ maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
- classpath 'com.google.gms:google-services:4.3.0'
+ classpath 'com.google.gms:google-services:4.3.2'
+ classpath 'io.fabric.tools:gradle:1.31.2' // Crashlytics plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -18,6 +20,7 @@ allprojects {
repositories {
jcenter()
google()
+ maven { url 'https://maven.fabric.io/public' }
}
}
app level gradle file:
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
+apply plugin: 'io.fabric'
android {
compileSdkVersion 29
@@ -93,6 +94,8 @@ dependencies {
implementation 'com.google.firebase:firebase-firestore:21.2.0'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
+ implementation 'com.google.firebase:firebase-analytics:17.2.0'
+ implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'org.dizitart:nitrite:3.2.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
I crashed my app several times using following method.
Crashlytics.getInstance().crash();
My device has an internet connection.
I tested using both a debug build and a release build (signed apk).
What could be the reason the dashboard not showing up any crash statistics yet, even after a day of crashlytis setup in the app?
回答1:
Add this at the bottom of the app level build gradle
apply plugin: 'com.google.gms.google-services'
and add google json to your app folder
回答2:
- Remove the line "Crashlytics.getInstance().crash()",
- Run your app on a Real Device,
- Unplug device,
- Close the app,
- Open the app on your device as it's unplugged.
Now Check the FireBase again. You should see some charts in Crashlytics Tab.
For testing crashes you can do the above process, but this time with code "Crashlytics.getInstance().crash()".
Note: Be sure to place this line outside your App Delegate’s "didFinishLaunching" method
来源:https://stackoverflow.com/questions/58514789/firebase-crashlytics-data-not-showing-up-in-dashbord-even-after-a-day-crashlytic