Log from CIQ_LOG.txt
WARNING: Error in mailbox callback
STORE_ID: 00000000000000000000000000000000
ERROR: Unexpected Type Error
DETAILS: Failed invoking <symbol>
STORE_ID: 00000000000000000000000000000000
CALLSTACK:
..Garmin notifier\source\Communication.mc (onIncomingMessage:153)
..Garmin notifier\source\Communication.mc (incomingMessage:41)
WARNING: Error in mailbox callback
STORE_ID: 00000000000000000000000000000000
Part of code from onIncomingMessage:
function onIncomingMessage(mailIter) {
if (mailIter instanceof Comm.MailboxIterator ) {
try {
/*line 153:*/ var message = mailIter.next(); //<- here is exception !!!
while(message != null) {
////some code
}
}
catch ( ex ) {
Log("Error during read message");
ex.printStackTrace();
}
}
Comm.emptyMailbox();
}
Calling Comm.emptyMailbox(); resolving my problem but in this case it didin't happen in onIncomingMessage() function. Unfortunatelly application alwais crashed when I tried to restart it. Only Call Comm.emptyMailbox() before Comm.setMailboxListener(method(:incomingMessage)); enables watchapp to restart and resolved the problem...
The question is: why block try.... catch doesn't work properly... Propably there is an issue in SDK, isn't it ?
BTW: Call following code when my application starts (i.e. in MyAPP constructor):
try {
Comm.emptyMailbox();
} catch (ex) {}
isn't good idea because application will crash on simulator. (On device won't.) But i think it is one way to allowing the application to restart in this case
Regards