10

I have successfully integrated Firebase into my project
(Authentication and Storage works great) but after the simple integration of Crashlytics and crashing my app on purpose (and not on purpose :) - No crash report appear in the crash dashboard.
i do see in Logcat:
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization
I/CrashlyticsCore: Crashlytics report upload complete: 5BEDB1320329-0001-43...

i have already integrated Crashlytics into 3 other apps with no problem, but for some reason it doesn't work in my new app.
Can anyone think of what i have missed?

a freshly downloaded google-services.json file is in place
and i added to the project gradle file:


    buildscript {
        repositories {
            maven {
               url 'https://maven.fabric.io/public'
            }
        }
        dependencies {
            classpath 'com.google.gms:google-services:4.2.0'
            classpath 'io.fabric.tools:gradle:1.26.1'
        }
    }

    allprojects {
        repositories {
           // ...
           maven {
               url 'https://maven.google.com/'
           }
        }
    }

and added to the app gradle file:


    apply plugin: 'io.fabric'

    dependencies {
        // ...
        implementation 'com.google.firebase:firebase-core:16.0.5'
        implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
    }

Thanks for your thoughts

Update
enabling Crashlytics debug logs shows that the crash was captured and reported but still nothing shows in the project's Firebase Crashlytics dashboard

D/CrashlyticsCore: Checking for crash reports...
D/CrashlyticsCore: Found crash report /data/.../files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5BEEA22001B0-0001-21C3-C00BC3A0D0B2.cls
D/CrashlyticsCore: Attempting to send 1 report(s)
D/Answers: Response code for analytics file send is 200
D/CrashlyticsCore: Adding single file 5BEEA22001B0-0001-21C3-C00BC3A0D0B2.cls to report 5BEEA22001B0-0001-21C3-C00BC3A0D0B2
D/CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com.salt.logomaker/reports
D/CrashlyticsCore: Create report request ID: null
D/CrashlyticsCore: Result was: 202
I/CrashlyticsCore: Crashlytics report upload complete: 5BEEA22001B0-0001-21C3-C00BC3A0D0B2
D/CrashlyticsCore: Removing report at /data/.../files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5BEEA22001B0-0001-21C3-C00BC3A0D0B2.cls
D/CrashlyticsCore: Checking for crash reports...
D/CrashlyticsCore: No reports found.
Ugi Fletzet
  • 129
  • 1
  • 1
  • 6
  • Mike from Firebase here. Can you share the actual package name of the app? – Mike Bonnell Nov 16 '18 at 14:38
  • @Mike Bonnell sure, it appears in the logs com.salt.logomaker , thanks – Ugi Fletzet Nov 17 '18 at 18:55
  • 10
    @Mike Bonnell i have found my problem, i was not aware that a former developer pasted io.fabric.ApiKey meta-data in the manifest file. after i deleted it the crashes started to appear in the dashboard. i will delete this question since it is not useful for others. thanks for your help! – Ugi Fletzet Nov 17 '18 at 21:20
  • I deleted the key in `manifests.xml` but still `Firebase` doesn't get any report. How can I solve that problem? – c-an Jul 03 '19 at 10:36
  • I have a similar issue -- I get some crashes (including the manual one from Crashlytics) reported, but not others. How do you enable Crashlytics debug logs in logcat? – Maurizio Macagno Sep 23 '19 at 21:40
  • @Maurizio Please take a look at the documentation to enable logs: https://firebase.google.com/docs/crashlytics/force-a-crash?platform=android – Ugi Fletzet Sep 26 '19 at 07:15
  • @UgiFletzet Thanks bro same problem here. My former developer also pasted io.fabric.ApiKey meta-data in the manifest file and after deleting it crashes started to appear in the dashboard. – jatin rana Jan 04 '20 at 16:17
  • @jatin glad it helped you :) – Ugi Fletzet Jan 05 '20 at 18:26

4 Answers4

6

I had the same problem, Crashlytics not reporting event trends neither crash stacktraces in PROD builds. The problem was in Proguard config. As stupid as it sounds, there is no reference at all about Proguard in all the documentation from Google. Here you can find what I had to add to make it work:

# Firebase
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

I hope this helps to you and many others, I've spent a week debugging and trying anything I've imagined.

Jorge Mathias
  • 96
  • 1
  • 3
  • 1
    There is reference to some of that here: https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?authuser=0&platform=android – jsharpe Nov 07 '19 at 19:09
  • Doesn't including the SourceFile allow for reverse engineering the app? – doctorram Apr 09 '21 at 03:55
0

Have you also added Fabric.with(this, Crashlytics()) to the onCreate of your main activity?

Alex
  • 11
  • 1
    Welcome to StackOverflow! Please provide a specific answer backed with references. If you have a suggestion or need clarification leave a comment. We have guidelines on [How to write a good answer](https://stackoverflow.com/help/how-to-answer). – Joseph Cho Nov 15 '18 at 19:17
  • 2
    the documentation does not state it is needed, but i also tried it and still doesn't work. https://firebase.google.com/docs/crashlytics/get-started?authuser=0 – Ugi Fletzet Nov 16 '18 at 10:28
0

For development applications, crashlytics will not upload any reports. You need to create a new version. React has a very well documented page about how to release new applications. As soon as you have the apk ready you can run android with the variant release. After doing this, your logs will start to have some crash reports uploads.

For a more detailed answer you can also see this stackoverflow post

Ricardo Ribas
  • 409
  • 4
  • 14
0

In my case for Android, I made the silly mistake of doing:

FirebaseCrashlytics.getInstance().setUserId(uid);

where uid was still null. Maybe this helps someone else.

policenauts
  • 512
  • 6
  • 18