1

我的应用程序中有一个NotificationListenerService实现。

似乎我在课堂上初始化的某些东西在我运行Application时没有初始化。NotificationListenerService此外,崩溃不是进入Crashlytics,而是进入Google Play,所以我假设初始化crashlytics也没有发生。

  • NotificationListenerService是否在应用程序的进程中没有调用扩展的服务类?
  • Application它是在上下文之外调用的吗?

我的代码的简化实现:

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Settings.init(this);
    }
}

public class MyNotificationService extends NotificationListenerService {
    @Override
    public void onCreate() {
        super.onCreate();
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                if (Settings.getSomething()) { // Crash! settings not initialized
                    ...
                }
            }
        }.execute();
    }
}
4

1 回答 1

1

It seems ~95% of reported crashes in Google Play come from a device called Vivo 1601, so this is most likely a bad implementation of Android on the device, or a rooted device repeatedly crashing.

Since this is not Crashlytics, I can't tell how many unique users have reported this crash, but it is safe to say It's not an issue in Android or my app.

于 2017-07-17T09:20:51.847 回答