Name of affected component: Core Reporting API
Issue summary: Google Analytics v4 does not report uncaught exceptions.
Steps to reproduce issue: Use the following code.
Thread.setDefaultUncaughtExceptionHandler(new ExceptionReporter(
GoogleAnalytics.getInstance(this).newTracker(R.xml.tracker),
Thread.getDefaultUncaughtExceptionHandler(),
this
));
throw new new RuntimeException("Testing Google Analytics");
where tracker.xml contains
<string name="ga_trackingId">UA-XXXXXXXX-X</string>
AndroidManifest.xml contains
<meta-data android:name="com.google.android.gms.analytics.globalConfigResource"
android:resource="@xml/global_tracker" />
global_tracker.xml contains
<integer name="ga_dispatchPeriod">1</integer>
<string name="ga_logLevel">verbose</string>
<bool name="ga_dryRun">false</bool>
Expected output: An uncaught exception should be reported to Google Analytics.
Actual results: Nothing is reported to Google Analytics; LogCat produces the
following
V/GAV4(31115): Thread[main,5,main]: Loading Tracker config values.
V/GAV4(31115): Thread[client_id_fetcher,5,main]: Loaded client id from disk.
V/GAV4(31115): Thread[main,5,main]: [Tracker] trackingId loaded: UA-53646323-2
V/GAV4(31115): Thread[main,5,main]: ExceptionReporter created, original handler
is com.android.internal.os.RuntimeInit$UncaughtHandler
V/GAV4(31115): Thread[main,5,main]: Tracking Exception: RuntimeException
(@MainActivity:onCreate:97) {main}
V/GAV4(31115): Thread[main,5,main]: Dispatch call queued. Dispatch will run
once initialization is complete.
V/GAV4(31115): Thread[main,5,main]: Passing exception to original handler.
V/GAV4(31115): Thread[GAThread,5,main]: connecting to Analytics service
V/GAV4(31115): Thread[GAThread,5,main]: connect: bindService returned true for
Intent { act=com.google.android.gms.analytics.service.START
cmp=com.google.android.gms/.analytics.service.AnalyticsService (has extras) }
I/GAV4(31115): Thread[GAThread,5,main]: No campaign data found.
V/GAV4(31115): Thread[GAThread,5,main]: Initialized GA Thread
V/GAV4(31115): Thread[Failed Connect,5,main]: falling back to local store
Original issue reported on code.google.com by goo...@forgetmedo.com on 23 Sep 2014 at 11:56
Original issue reported on code.google.com by
goo...@forgetmedo.com
on 23 Sep 2014 at 11:56