14

Crashlytics works just fine without opt-in reporting. But it stops reporting anything as soon as I set up opt-in reporting according to the tutorial.

Specifically, I added the following content to AndroidManifest.xml

<meta-data
    android:name="firebase_crashlytics_collection_enabled"
    android:value="false" />

And I added the following into the onCreate:

 Fabric.with(this, Crashlytics())

With a debugger, I am sure that the above line has been executed.

However, nothing is reported to the Crashlytics. Instead, the logger gives the following,

D/Fabric: Falling back to Crashlytics key lookup from Manifest
D/Fabric: Falling back to Crashlytics key lookup from Strings
D/Fabric: Generating Crashlytics ApiKey from google_app_id in Strings
D/Fabric: Using AdvertisingInfo from Preference Store
D/Fabric: Falling back to Crashlytics key lookup from Manifest
D/Fabric: Falling back to Crashlytics key lookup from Strings
D/Fabric: Build ID is: ...
D/CrashlyticsCore: Crashlytics is disabled, because data collection is disabled by Firebase.
D/Fabric: Initializing io.fabric.sdk.android:fabric [Version: 1.4.6.29], with the following kits:
    com.crashlytics.sdk.android:crashlytics [Version: 2.9.7.29]
    com.crashlytics.sdk.android:beta [Version: 1.2.10.27]
    com.crashlytics.sdk.android:answers [Version: 1.4.5.29]
    com.crashlytics.sdk.android.crashlytics-core [Version: 2.6.6.29]
D/Fabric: Not fetching settings, because data collection is disabled by Firebase.
D/Fabric: Falling back to Crashlytics key lookup from Manifest
D/Fabric: Falling back to Crashlytics key lookup from Strings
D/Fabric: Build ID is: ...
D/Fabric: Analytics collection disabled, because data collection is disabled by Firebase.
D/Fabric: Could not get parcel from Google Play Service to capture AdvertisingId
D/Fabric: Could not get parcel from Google Play Service to capture Advertising limitAdTracking
D/Fabric: AdvertisingInfo not present
D/Fabric: Asychronously getting Advertising Info and storing it to preferences

I have noticed this interesting line: D/CrashlyticsCore: Crashlytics is disabled, because data collection is disabled by Firebase. which is probably the cause of the issue. Yet I can't find any information about this log.

4
  • 2
    I am experiencing exactly the same problem, and it seems that is is a bug in version 2.9.7. With that version if Crashlytics is disabled in manifest it is not possible to enable it programmatically. Using 2.9.6 the same code works perfectly.
    – gxcare
    Dec 12, 2018 at 0:15
  • @gicci Downgrading to 2.9.6 made it work! You should write this as an answer and I will accept it :) Thank you!
    – Null
    Dec 12, 2018 at 12:10
  • reason maybe that you need to migrate from fabric Jan 9, 2020 at 13:24
  • Make sure for meta tags first then upgrade, in my case the code was too old and meta tag was false. Jun 21, 2021 at 4:56

8 Answers 8

14

There is an issue with Firebase Crashlytics 2.9.7 preventing opt-in reporting as described in the documentation to work: the start of Crashlytics from code will not be performed. For the time being downgrading to 2.9.6 will enable your code to work properly.

4
  • 1
    Man this drove me crazy
    – FrankMonza
    Dec 19, 2018 at 8:34
  • It was the same for me until I saw this question here. Anyway the bug was confirmed also by Firebase support which I contacted.
    – gxcare
    Dec 20, 2018 at 13:06
  • 4
    is this solved in 2.10.1? As I am still facing the issue
    – Ravi Yadav
    Aug 22, 2019 at 9:37
  • I face same with 2.10.1. Downgrading to 2.9.6 fixes the issue. Could it be that the bug only appears in more recent created firebase projects? We have an old project that works with 2.10.1 but our new project only works with 2.9.6
    – lilienberg
    Sep 2, 2019 at 13:43
2

Please follow this answer https://stackoverflow.com/a/59906454/6743289

For those wish to use crashlytics for their android app who haven't been using crashlytics of fiber.io, there are certain changes in the way you FirebaseApp is initialized which you will find in the above link.

1

Use following dependencies for android.
Paste it into build.gradle app:

implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true
}

Upgrade it from 2.9.5 to 2.9.6.
It works for me.

0
0

Add this line into Application class

Fabric.with(this, Crashlytics())
1
  • Hi, thank you for your reply but I have already added this into the onCreate of my activities and I can confirm that this line is executed, as I have mentioned in my question.
    – Null
    Dec 11, 2018 at 23:23
0

Crashlytics 2.9.8 has been released which fixes the bug. I've tested to confirm. The changelog:

2.9.8 December 21, 2018

  • Fixed bug with firebase_crashlytics_collection_enabled flag that erroneously disabled data collection under some circumstances.
4
  • 3
    Facing the issue in 2.10.1 . I am testing using this line 'Crashlytics.getInstance().crash();'
    – Ravi Yadav
    Aug 22, 2019 at 9:42
  • @DKV yes it worked after some delay. I was facing difficulty in multi module app.
    – Ravi Yadav
    Jan 24, 2020 at 9:07
  • @Ravi Yadav: for me debug build working perfectly. But not the release
    – DKV
    Jan 24, 2020 at 9:43
  • @DKV invited you to chat
    – Ravi Yadav
    Jan 24, 2020 at 9:52
0

Initialization of app is not mentioned anywhere to get crashlytics report on our console!

Step 1. First follow the official doc's link to include all dependencies as it is given there and setup your firebase app through firebase console.

Step 2. Now do the following initialization in your base application class or base activity class.

FirebaseApp.initializeApp(getApplicationContext()); FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true); Now clean you project and do some force crash for few times, you should be able to see your crashlytics report on your firebase console

0

I had the same issue. I followed Test Your Crashlytics implementation to debug the issue.

Setting FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true) fixed the issue, even though I expected it to be doing that by default

0

If you are done add dependency and other steps still not working means you can turn on your internet then try to crash it will be report into the firebase dashboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.