I'm using Google Analytics SDK v4 for Android to record the exceptions. I followed the sample app but I could see no exceptions getting registered in the dashboard.
I wrote the code as below
/*exception tracking */
// Get tracker.
Tracker t2 =
((MyApp) this.getApplication()).getTracker(TrackerName.APP_TRACKER);
// Build and send exception.
int a = 0;
String exceptionStr = "";
try{
int b = a/0;
}catch(Exception ex){
exceptionStr = ex.toString();
}finally{
t2.send(new HitBuilders.ExceptionBuilder()
.setDescription(exceptionStr + ":" + "In Main screen")
.setFatal(true)
.build());
GoogleAnalytics.getInstance(this.getApplicationContext()).dispatchLocalHits();
Log.v("Manual logging", "finished for analytics");
}
"Manual logging", "finished for analytics"
is showing up in the logcat window but when I check the analytics there is nothing registered.
BTW the user screen flow etc working just fine with the SDK. Just the exception logging is not working.