[TIMOB-12969] Crittercism module does not show any crash or handled exception in live stat section
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Cannot Reproduce |
| Resolution Date | 2013-03-20T23:44:40.000+0000 |
| Affected Version/s | Release 3.0.1, Release 3.0.2 |
| Fix Version/s | 2013 Sprint 06 API, 2013 Sprint 06 |
| Components | Android |
| Labels | mobilesdk, module, titanium |
| Reporter | Ashish Nigam |
| Assignee | Blain Hamon |
| Created | 2013-03-06T09:37:23.000+0000 |
| Updated | 2017-03-21T21:36:56.000+0000 |
Description
I Tested the sample code provided with Crittercism module and found that live stats are not working for Crash and Handled Exception with Android 2.2 and above.
Also i get app load only for 1st time app launch with Titanium SDK version change. like when i change TiSDK from 3.0.0 to 3.0.2 or vice versa.
Ti.API.info("Ti App: importing Crittercism...");
var crittercism = require('com.crittercism.ti.android');
Ti.API.info("module is => " + crittercism + "\n");
Ti.API.info("Ti App: initializing Crittercism...");
crittercism.init("5004e9d1be790e78f2000006");
Ti.API.info("Ti App: Crittercism initialized\n");
var win = Titanium.UI.createWindow({
title : 'Crittercism Test',
backgroundColor : '#fff'
});
crittercism.leaveBreadcrumb("Creating window");
var topLabel = Titanium.UI.createLabel({
top:10,
color : '#999',
text : 'Crittercism Test App!',
font : {
fontSize : 16,
fontFamily : 'Helvetica Neue'
},
width : 'auto'
});
win.add(topLabel);
var setMetaData = Titanium.UI.createButton({
top:35,
width:301,
height:30,
title:'Set Metadata'
});
setMetaData.addEventListener('click', function()
{
crittercism.leaveBreadcrumb("setMetaData // Setting Username");
crittercism.setUsername("TomCritter");
try {
crittercism.leaveBreadcrumb("Attempting to add Metadata");
crittercism.setMetadata({
"gameLevel": 5,
"email": "support@crittercism.com",
"playerID": 9491824
});
} catch (e) {
Ti.API.error("set Metadata: JSON failed");
}
});
win.add(setMetaData);
var crashButton = Titanium.UI.createButton({
top:70,
width:301,
height:30,
title:'Crash'
});
crashButton.addEventListener('click', function()
{
crittercism.leaveBreadcrumb("Clicking the crash button");
// create an array with an invalid size
var a = new Array(0x100000000);
var array = new Array();
// access an index out of bounds
array[-4]; // this doesn't get caught
win.add(array[-4]); // this gets caught
// throw an exceptions
var er = new Error("My Not as Awesome Uncaught Error!");
throw er
});
win.add(crashButton);
var handledButton = Titanium.UI.createButton({
top:105,
width:301,
height:30,
title:'Send Handled Exception'
});
handledButton.addEventListener('click', function()
{
try {
crittercism.leaveBreadcrumb("Attempting some awesome task...");
var err = new Error("My Awesome Caught Error!");
throw err
} catch (err){
crittercism.leaveBreadcrumb("Oh no, it failed! Log it...");
crittercism.logHandledException({
name: err.name,
message: err.message,
line:err.lineNumber
});
}
});
win.add(handledButton);
var status = false;
var optOutToggle = Titanium.UI.createButton({
top:140,
width:301,
height:30,
title:'Toggle OptOut Status: No'
});
optOutToggle.addEventListener('click', function()
{
// Set the status
crittercism.setOptOutStatus(status = !status);
// change the status in the button title for visibility
var stringStatus = crittercism.getOptOutStatus() ? "Yes" : "No";
optOutToggle.title = 'Toggle OptOut Status: ' + stringStatus;
});
win.add(optOutToggle);
win.open();
Max, We tested the issue in house. Exceptions are getting populated into the dashboard properly. However, the crash reports not being recorded or get populated into the dashboard. Shak
When starting up, we see in logcat:
Stack Overflow says [this might be okay](http://stackoverflow.com/questions/11840937/apache-http-client-nafhttpauthstrategydefault). Odder and odder. In clicking the 'send handled exception', I see in the logcat:I/ActivityManager( 238): Start proc com.appcelerator.crittercismTest1 for activity com.appcelerator.crittercismTest1/.Crittercismtest1Activity: pid=16427 uid=10061 gids={1015, 1007, 3003} I/dalvikvm(16427): Turning on JNI app bug workarounds for target SDK version 8... ... I/TiAPI (16427): Ti App: importing Crittercism... I/TiAPI (16427): module is => [object Object] I/TiAPI (16427): Ti App: initializing Crittercism... I/APACHE HTTP (thCr=24364) - NafHttpAuthStrategyDefault(16427): (thUse=24364) NafHttpAuthStrategyDefault() I/APACHE HTTP (thCr=24364) - KeeperManager(16427): (thUse=24364) INITIALIZATION of shared resources I/APACHE HTTP (thCr=24364) - AndroidContextProviderImpl(16427): (thUse=24364) currentActivityThread=null I/APACHE HTTP (thCr=24364) - GbaSupportIndicatorRequestUpdaterDefault(16427): (thUse=24364) GbaSupportIndicatorRequestUpdaterAbstract() userHeaderPredefined=null I/Crittercism(16427): Crittercism Initialized. I/Crittercism(16427): sendAppLoadData() will only send data to Crittercism if "delaySendingAppLoad" is set to true in the configuration settings you include in the init call. I/TiAPI (16427): Ti App: Crittercism initialized I/APACHE HTTP (thCr=24364) - NafHttpAuthStrategyDefault(16427): (thUse=24370) cached value : gbaSupportIsPossible=null I/APACHE HTTP (thCr=24364) - NafHttpAuthStrategyDefault(16427): (thUse=24370) The current context is NOT a context of GBA service. I/APACHE HTTP (thCr=24364) - GbaSupportPermissionRequestCheckerImpl(16427): (thUse=24370) isCurrentProcessRequestedGba()#finished result=false I/APACHE HTTP (thCr=24364) - GbaSupportPermissionRequestCheckerImpl(16427): (thUse=24370) isCurrentProcessAllowedToUseGba()#started result=false I/APACHE HTTP (thCr=24364) - NafHttpAuthStrategyDefault(16427): (thUse=24370) The GBA permission wasn't requested for this process. I/APACHE HTTP (thCr=24364) - NafHttpAuthStrategyDefault(16427): (thUse=24370) It is impossible to support GBA now (many possible reasons: no Android Context, current client is GBA service, etc.), then it will be just usual HTTP. I/APACHE HTTP (thCr=24370) - NafRequestExecutorWrapperRedirectionHandler(16427): (thUse=24370) It isn't GBA flow, redirection responses are not handled.Without much investigation into the code, this looks internal to Crittercism, given the class name does not have ti in the path. As far as I can tell, Crittercism may have a service set up (the one we're trying to kill) and some logic is causing an exception to stop us from logging. Question is: Where do we go from here? Are we actually seeing any of this showing up on the crittercism site?Okay, an update: In generating a new application code ( 514a43cf5f721646f000000a ) for the app, I could see the handled exceptions show up fine. Despite the button label, the crash is actually an exception, even if one presses Kill. Crash Test Dummy would be needed to test an actual crash. I'm not sure what the actual issue is. Moving to cannot reproduce until more detail is given.
Please provide more information, and reopen then.
Closing ticket as the issue cannot be reproduced and due to the above comments.