我在我的Android应用程序中使用乱码跟踪崩溃和错误。我最近发现一个问题,我的一些错误(用onError()方法记录)没有显示在乱码analitycs上。Flurry不报告所有错误
为了测试它是不是某种配置问题或延迟,我从应用程序的不同位置引发了一些错误,使用相同的配置。因此,我看到从活动中解雇的错误得到了正确的接收,但是我的服务引发的一些错误没有收到。 我启用了乱码日志,他们说这些错误已发送,但乱舞的仪表板没有看到它们。
例如,从未收到的错误是我从自定义的UncaughtExceptionHandler中触发的错误,因为Flurry并未报告服务崩溃。下面是它的代码:
final Context context = this;
final Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
Log.e(TAG, "ERROR DETECTED------------------------------------------", ex);
//Utils.sendFlurryError(context, "serviceCrash", "Uncaught error in Swiper Sevice",new Exception(ex));
FlurryAgent.onError("serviceCrash","Uncaught error in Swiper Service",ex);
NotificationManagerCompat manager = NotificationManagerCompat.from(context);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setContentIntent(PendingIntent.getActivity(context, 42, new Intent(context, AppConstants.LAUNCH_CLASS), 0))
.setSmallIcon(R.drawable.icon_notif2)
//.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.logo_rond))
.setGroup("swiper")
.setAutoCancel(true)
.setContentTitle("Swiper")
.setContentText("Swiper met an error. Please restart swiper to correct it");
manager.notify(Notification.SWIPER_NOTIF_ID, builder.build());
uncaughtExceptionHandler.uncaughtException(thread, ex);
}
});
如果你们遇到这样的错误,知道一个办法解决,这将是非常赞赏
没有真正回答我的问题,但它的作品,所以...... meh。 – Laetan