simplepeng / SpiderMan

🔥🔥🔥 - 崩溃日志手机端显示 ,测试妹妹的最爱,开发哥哥的小棉袄
MIT License
1.29k stars 165 forks source link

init protected? #20

Closed krmao closed 3 years ago

krmao commented 3 years ago
    private SpiderMan() {
        Thread.setDefaultUncaughtExceptionHandler(this);
    }

    protected static void init(Context context) {
        mContext = context;
        spiderMan = new SpiderMan();
    }

image

simplepeng commented 3 years ago

@krmao 最新版本有自动初始化了,不再需要手动initimage

krmao commented 3 years ago

注意到了, 不过目前使用触发一个 java crash 直接奔溃了,并没有显示 spider man

    debugImplementation "com.simple:spiderman:1.1.7"
    releaseImplementation "com.simple:spiderman-no-op:1.1.5"
class FinalApplication : Application() {

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        STInitializer.attachApplicationBaseContext(base)
    }

    override fun onCreate() {
        super.onCreate()
        SpiderMan.setTheme(R.style.SpiderManTheme_Dark)
    fun testJavaCrashNullPointerInMainThread_onClick(view: View?) {
        val text:String? = null
        text!!.toString()
    }

不知道与 xcrash 是不是不兼容还是其他原因

https://user-images.githubusercontent.com/7344437/112825728-b3396080-90be-11eb-8b0a-221ab7bcbb8f.MP4

提交记录 https://github.com/krmao/template/commit/8c955fae60966fa2f3bd764ea1eb63a9246d5325

simplepeng commented 3 years ago

被xcrash抢占了,可以自己写逻辑,debug环境不初始化xcrash