如何从android发送关于google analytics调试的崩溃报告

如何从android发送关于google analytics调试的崩溃报告,android,google-analytics,Android,Google Analytics,我想手动发送崩溃报告。所以在发布apk之前,我想测试一下。但当应用程序崩溃时,tracker会发送数据,但play developer控制台上的崩溃报告网页上没有任何更改。我如何测试它 // tracker.enableExceptionReporting(true); tracker.enableAdvertisingIdCollection(true); tracker.enableAutoActivityTracking(true); mExce

我想手动发送崩溃报告。所以在发布apk之前,我想测试一下。但当应用程序崩溃时,tracker会发送数据,但play developer控制台上的崩溃报告网页上没有任何更改。我如何测试它

     //      tracker.enableExceptionReporting(true);
    tracker.enableAdvertisingIdCollection(true);
    tracker.enableAutoActivityTracking(true);
    mExceptionParser = new StandardExceptionParser(getApplicationContext(), new ArrayList());
    analytics.setDryRun(true);
    analytics.setAppOptOut(BuildConfig.DEBUG);

    Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread t, Throwable e) {

            tracker.send(new HitBuilders.ExceptionBuilder()
                    .setDescription(
                            new StandardExceptionParser(getApplicationContext(), null)
                                    .getDescription(t.getName(), e))
                    .setFatal(true)
                    .build());

            analytics.dispatchLocalHits();


            DisplayMetrics metrics = getApplicationContext()
                    .getApplicationContext().getResources()
                    .getDisplayMetrics();
            if (metrics.densityDpi == DisplayMetrics.DENSITY_LOW
                    || metrics.densityDpi == DisplayMetrics.DENSITY_MEDIUM) {

                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.addCategory(Intent.CATEGORY_HOME);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                getApplicationContext().startActivity(intent);
                System.exit(0);

            } else {

                Intent intent = new Intent(getApplicationContext(),
                        main.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                getApplicationContext().startActivity(intent);
                if (activity != null)
                    activity.finish();
            }

            System.exit(0);
            android.os.Process.killProcess(android.os.Process.myPid());
    //
    //                Thread.UncaughtExceptionHandler googleException = new      ExceptionReporter(
    //                        tracker,
    //                        null,
   //                        getApplicationContext());
     //                googleException.uncaughtException(t,e);

        }
    });

你也可以试试crashlytics。我在我所有的应用程序中都使用它。这里是链接-。希望它能帮助你