我随机得到
A/libc: Fatal signal 31 (SIGSYS), code 1 in tid 8679 (pool-2-thread-1), pid 8413 (mgiveawaywinner)
在我的应用程序启动后(并因此崩溃)。
我是非常随机的,因此如果在Android Studio上从5开始启动(不作任何额外更改),可能会崩溃2,这让我认为与线程在开始时的运行顺序有关。
问题是我既没有使用C也没有使用任何疯狂的外部api,那么如何调试和跟踪此问题的根源?
在这里复制代码很复杂,因为我不知道错误在哪里抛出,而且我需要粘贴整个应用程序才有意义(因为我不知道原因),但是我可以简单地说一下
在初始化时我要做的事情:
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL, name, importance);
channel.setDescription(description);
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
this.preferences = PreferenceManager.getDefaultSharedPreferences(this);
this.threadPool = AsyncTask.THREAD_POOL_EXECUTOR;