65

GitHub - BolexLiu/AutoEx: 帮助Android开发者,让项目在崩溃时从异常堆栈中,自动寻...

 6 years ago
source link: https://github.com/BolexLiu/AutoEx
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

AutoEx

帮助Android开发者,让项目在崩溃时从异常堆栈中,自动寻找Stack Overflow的回答。

AutoEx api+svg sizesvg stackoverflow

项目崩溃后,你的LogCat日志会出现来自Stack Overflow的回答。

像下面这样:

┌—————————————————————AutoEx——————————————————————
├ 错误类型:android.content.res.Resources$NotFoundException: Resource ID #0x7f0b0056 type #0x12 is not valid。↑详细异常请往上滚动查看↑
├ 推荐参考Stack Overflow上4条同类问题。↓点击下方连接查看↓
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
├ 标题:Android Resources$NotFoundException: Resource ID #0x7f030027
├ 链接:https://stackoverflow.com/questions/21269502/android-resourcesnotfoundexception-resource-id-0x7f030027
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
├ 标题:android.content.res.Resources$NotFoundException: Resource ID #0x7f07007e
├ 链接:https://stackoverflow.com/questions/48161713/android-content-res-resourcesnotfoundexception-resource-id-0x7f07007e
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
├ 标题:App crashes when adding an ImageView?
├ 链接:https://stackoverflow.com/questions/47600747/app-crashes-when-adding-an-imageview
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
├ 标题:XML Android app will not load on phone
├ 链接:https://stackoverflow.com/questions/48310838/xml-android-app-will-not-load-on-phone
└—————————————————————AutoEx——————————————————————

用法

  • 1.根build.gradle添加仓库:
allprojects {
    repositories {maven { url 'https://jitpack.io' }}
}
  • 2.添加dependency依赖
dependencies {
    implementation 'com.github.BolexLiu:AutoEx:v1.0.6'
}
  • 3.Application初始化一行搞定
 AutoEx.apply(this);

或者你也可以自己配参数

  /**
     * @param mApp    Applicatin
     * @param maxSize 最大提示答案数目
     * @param tag     自定义日志 默认 AutoEx
     * @param isDebug 是否开启调试 true为开启 false为关闭 默认开启
     */
    public static void apply(Context mApp, int maxSize, String tag, boolean isDebug)

android support:

  • minSdkVersion 14
  • maxSdkVersion 26+

更新描述

  • 1.0.5 修复小米等手机直接被Kill,添加多进程
  • 1.0.6 最大提示数目、增加日志过滤、调试模式选择

预备需求

  • 基于搜索引擎扩展结果,避免精准匹配的异常有时候出不来的问题。要考虑墙的问题(google? bing?)
  • 编译时gradle异常提示,目前只是运行时的,gradle取error的日志我试了一下是没问题的,做成插件就可以用了。等有空再折腾

AutoEx仅不到9kb的大小。为了保持精简干净不给开发者添麻烦,AutoEx放弃依赖第三方库。(比如OKHttp、Gson等)。 所以你不用担心依赖冲突等问题。另外请保持手机是联网状态的。希望能给你带来方便。欢迎pr,么么哒。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK