App works in simulator but *.prg fails when copied to watch

After testing on the simulator I've been copying the *.prg to the /GARMIN/APPS/ on the USB attached 735xt to check.

Sometimes something seems to go wrong in the copy - I've tried waiting 60 seconds after the copy completes, I've tried explicitly Ejecting the USB drive from Windows 10, without luck. Copying again usually seems to clear it, but now I seem to be caught in a loop where it fails on the first attempt to access a layout

ERROR: Invalid Resource Specified
DETAILS: Failed invoking
STORE_ID: 00000000000000000000000000000000
CALLSTACK:
Rez (initialize:101)
Rez (ErrorLayout:156)
C:\Users\abs\git\trainasone-connectiq\source\ErrorView.mc (onLayout:18)


The offending line is a

function onLayout(dc) {
setLayout(Rez.Layouts.ErrorLayout(dc)); <---


Have tried copying very many times

I also can't get the app logs to write, just the CIQ_LOG.TXT. My app is called trainasone-connectiq and I've tried trainasone-connectiq.txt and trainasone-connectiq.TXT

I'm trying to get a new test versions out to users and Fenix 5 testers are reporting the app failing with

UnexpectedTypeException: Expected String, given Number
native function
native function


in a makeWebRequest() call which used to work fine, and in fact is preceded with another makeWebRequest() which has similar parameters apart from a url tweak and response types, but now I can't even test anything on my 735xt because its in this unhappy place.

Maybe there is a better way to test on actual devices - would be very happy to hear of it but I couldn't find it from the docs and it seems that quite often when I finish testing in the simulator and copy to the device it fails in a different way.

It really is exhausting trying to develop for Connect IQ. A lot of time adding features to this version and it was tested under all the different simulators (and a physical 735xt) but as soon as it was sent it out to users it fails in a inexplicable way.



  • There is something weird in your set up. The SDK hasn't changed in a bit, nor has the Eclipse Plugin.

    I've been using the "build for device wizard" since the 1.x.x days without a problem. Could it be you aren't picking the proper target when you use the wizard? (I've been there and done that! :) )

  • Oh wait!
    setLayout(Rez.Layouts.ErrorLayout(dc)); <---
    I have no idea what you are doing here! Why are you trying to pass a dc? Seems you'd be using the current dc in onUpdate to me...
  • The passing of the dc in onUpdate was cargo-culted code from examples I've seen. I'll read up on the docs to try to fill in some of my understanding there.

    I hadn't been using the device wizard - for the the initial version I'd just taken the built binary from the bin directory and it had Just Worked. Now I know better (thanks) 735xt target copied to my test device runs far enough to see the strange second makeWebRequest issue.

    So presumably the development built binaries are built fat with enough information for the simulator to run for any target, while the device wizard builds for a single target? That makes sense. I'll also read up on scripting something to build my target set as manually generating all desired targets with that is going to drive the automater in me mad

    Thanks for resolving my "why am I making bad binaries" self inflicted wound.

    Now I can start looking at code issues! (getting logs on the device would help :)

    David
  • When you build for a target in the sim, it includes debug info. It will be larger because it's a debug build, but still target specific.
    When you use the "build for device wizard" there's a checkbox if you want to build a release build. When you build a .iq, all the .prgs are release builds.