Akhilesh Mani
Akhilesh Mani

Reputation: 3552

Android Add Firebase Crashlytics in Library Project

I am trying to configure Firebase Crashlytics in my library project. According to Firebase its not possible to configure Crashlytics in the library project.

I am getting this error message.

Crashlytics was applied to an android-library project.

Android-library support is currently an incubating feature. 

Help me if you have any solution or workaround.

I just wanted to log library project crashes in Firebase Crashlytics.

Upvotes: 10

Views: 1833

Answers (1)

Faraz Hassan
Faraz Hassan

Reputation: 693

I recently worked on a library and from the get go, we knew that we won't be able to integrate an out of the box solution for this as it'll always conflict with consumer apps' implementation of the service like Firebase.

We opted for a different strategy. Handle all the crashes in the library ourselves and then heres what we do with them:

  1. A listener set by the consumer app is notified of the error as a callback
  2. Post the error logs to our own custom API server on next restart of the app and forward these logs onto different services like Firebase.

I understand this is not an exact solution that tells you how to use Firebase Crashlytics in a library but posting here as it gets the same work done.

Upvotes: 5

Related Questions