简体   繁体   English

Android 在库项目中添加 Firebase Crashlytics

[英]Android Add Firebase Crashlytics in Library Project

I am trying to configure Firebase Crashlytics in my library project.我正在尝试在我的库项目中配置 Firebase Crashlytics。 According to Firebase its not possible to configure Crashlytics in the library project.根据 Firebase 的说法,无法在库项目中配置 Crashlytics。

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.我只想在 Firebase Crashlytics 中记录库项目崩溃。

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.我最近在一个库上工作,从一开始,我们就知道我们将无法为此集成开箱即用的解决方案,因为它总是与消费者应用程序对 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.在应用程序下次重新启动时将错误日志发布到我们自己的自定义 API 服务器,并将这些日志转发到不同的服务,例如 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.我知道这不是一个确切的解决方案,它告诉您如何在库中使用 Firebase Crashlytics,而是在此处发布,因为它完成了相同的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM