Code working on sim but not on some devices

Hi!

I did one app, in the simulator it works perfect for the Vivoactive4s and for the Forerunner245. Once installed in the device, in the Vivoactive all goes perfect but it is not the case for the fr245. The problem is that the fr245 is a friend device, so I cannot play with it, he just told me that is not working. So I started to play with mine, the vivoactive.

I created a txt log file in GARMIN/APP folder and checked the output after using the app in the Vivoative4s, this is the result (note that even there is an error, it didnt crashed in the device and the simulator):

Error: Unexpected Type Error

Details: 'Failed invoking <symbol>'

Time: 2022-02-17T06:51:02Z

Part-Number: 006-B3224-00

Firmware-Version: '6.50'

Language-Code: spa

ConnectIQ-Version: 4.0.9

Store-Id: 87addc02-b241-4200-9757-4cf9d08c6027

Store-Version: 3

Filename: C2BF0125

Appname: Paris Velib

Stack:

  - pc: 0x100003cf

  - pc: 0x10000229

I checked the xml file (with your help Jim, thanks!!) and I found that the problem is in between pc="268436403" and pc="268436437" meaning lines 122 and 124 of my file (line 123 is commented). These are the lines:

122     View.findDrawableById("lblEstacion").setText(labelString1);
     
124    var labelString2 =""+Current_meca;
var labelString1 =Current_station (line 121), Current_station  and Current_meca are values that I get from a makeWebRequest. In the simulator and the Vivoactive4s they are correct (two string values).
Somebody knows which could be the problem? and why is it working in the sim for both devices and properly in the real Vivoactive4s but not in the fr245?
Thanks a lot for your help
  • If you create a <myappname>.txt file in the apps\logs folder, you can use println() calls to see what's going on.  Send your friend a sideload with the println calls and instructions on creating the log file.  This is much easier to do with a sideload, as stuff in the store gets assigned it's own 8 char name for the prg, and the .txt file must use that same name.

  • thank you for your answer. Yes, I was thinking on doing that. You mean to use println(labelString1), println(Current_meca) and println(Current_station) to see whats inside, isnt it? Or where you would use the printIn? Is it possible to print a general log file with all the steps done my the app until it crashes?

    The problem is that in the vivoactive4s (my device) it works perfect but in the <myappname>.txt of my vivoactive, there is already one error:

    "Error: Unexpected Type Error ; Details: 'Failed invoking <symbol>' ;"

    corresponding to these two lines 122 and 124 (not sure in which one is it):

    122     View.findDrawableById("lblEstacion").setText(labelString1);    
    124    var labelString2 =""+Current_meca;
    Do you see something strange in these two lines?
    Thanks!
  • The error you see is in the ciq_log.yml.  The only thing in your <appname>.txt is whay you write using System.println() calls

  • And what is the ciq_log.yml? Why there is an error there linked to my app "Appname: Paris Velib"?

  • ciq_log.yml gets info when your app crashes.  (often seen as a iq! on the device).  <appname>.txt will log anything you want, like the contents of a variable, using System.println() calls.  The same as you'd see in the console when running in the sim.

  • Thanks for this information. I need to check. It is strange to have info of the app crashing... when in my watch didnt crash.

    I am going to print as much as possible variables using System.println() calls in a side app for my watch and for my friends watch.

    But... if the app crashes, it will not be able to do all the System.println() calls, so I am not sure if I will find something. Moreover, the ciq_log.yml already tells me that there is a problem in those two lines, I will print all those variables.

    By the way, the line:

              var labelString2 =""+Current_meca;

    should work? How to define a variable (labelString2) by pointing just to a string (Current_meca)? If I do only labelString2=Current_meca, it didnt work.. so I had to add ""+ before...

    Thanks!!

  • Do the println calls right before the crash and you can see what they are when it crashes.  It kind of sounds like one of them has a bogus value causing the crash,

  • Thanks Jim, I will keep you informed! thanks