简体   繁体   English

一个安卓库的崩溃报告 - 与应用程序iteslf无关

[英]Crash report for an android library - not to be related to the application iteslf

I'm looking for a crash reporter api, which will work on an sdk that we've been developing, regardless of the app which uses the sdk. 我正在寻找一个崩溃记者api,它可以处理我们一直在开发的sdk,无论使用sdk的应用程序如何。

I don't want all the apps that uses our sdk to do any other definitions for this purpose, I want it to be in the background, and not related the the app's gradle, manifest or Application's onCreate method. 我不希望所有使用我们的sdk的应用程序为此目的做任何其他定义,我希望它在后台,并且与应用程序的gradle,manifest或Application的onCreate方法无关。

I've been searching a lot for this, and all the api i found demanding one of the requirements in the paragraph above. 我一直在寻找这个,所有的api我发现要求上面段落中的一个要求。

So, here's a list of sdk that i've looked into, all of them require an app definition, which doesn't fit my needs. 所以,这里是我查看的sdk列表,所有这些都需要一个应用程序定义,这不符合我的需求。

  1. Firebase : Fe, firebase is require to set the gradle dependency in the app level, define the app itself and init the sdk in the application context(which i can handle in the library) : Firebase :Fe,firebase需要在应用程序级别设置gradle依赖关系,定义app本身并在应用程序上下文中启动sdk(我可以在库中处理):

     compile 'com.google.firebase:firebase-crash:10.2.0' 
  2. Crashlytics Crashlytics

  3. acra ACRA
  4. New relic 新遗物
  5. instabug instabug
  6. apteligent apteligent
  7. hockeyapp hockeyapp

Please don't offer something like 'make all the apps that using the sdk define x,y,z' - this is not the solution i'm looking for. 请不要提供类似'使用sdk定义x,y,z的所有应用程序' - 这不是我正在寻找的解决方案。

I don't think there are any libraries that work the way you want. 我不认为有任何库可以按照你想要的方式工作。

However what you could do, is to fill all your outwards facing methods with try/catch(Exception e) and handle the logging yourself. 但是你可以做的是用try / catch(Exception e)填充所有面向外的方法并自己处理日志。 Eg simply by silently sending an email or by some REST call. 例如,只需通过静默发送电子邮件或通过一些REST调用。

Be sure to throw the exceptions again after sending, so that the implementing app can deal with the failure as well and is not left in a state where it thinks what your lib did worked, when it actually failed. 确保在发送之后再次抛出异常,以便实现应用程序也可以处理失败,并且不会处于它认为你的lib工作的状态,当它实际失败时。

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

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