SDK 3.2.x builds for venu2/venu2s "successfully", but app crashes at runtime (expected build to fail)

Since the bug reports forum isn't sorted by date (so it's not easy to see recent posts other than the most recent one), I'm reposting this here for others to see.

TL;DR I think if you try to build an app for venu2/venu2s with SDK 3.2.x, the build should fail, but instead the build "succeeds" and the app crashes at runtime.

forums.garmin.com/.../sdk-3-2-x-builds-for-venu2-venu2s-successfully-but-app-crashes-at-runtime-expected-build-to-fail

Description of Problem

The venu2/venu2s devices apparently require Connect IQ SDK 4.x.x, which is understandable, since they're new with Connect IQ 4.x.x.

However, if I create a data field app with venu2/venu2s support and build with Connect IQ 3.2.x, the build completes without error, but the app simply crashes at runtime.

I expected the app to fail to build. Even more disturbingly, "Export Project" works without error (I have no idea what would happen if I submitted this app to the store -- hopefully the app would fail automated review)

Seems like compiler.json for each device should specify a *minimum* SDK version. This was obviously not a problem in the past when each SDK distribution included its own list of supported devices, but it seems like it will be a problem going forward every time a new set of devices is released that is incompatible with older SDKs which nonetheless use the "Device Library" (i.e. CIQ 3.2.x and higher)

  • From the news & announcement thread for the new devices:

    "The Venu® 2/2s is our first Connect IQ product using API level 4.0.0 and requires the Connect IQ 4.0.0 SDK."

    I wouldn't expect things to work with a 3.2 sim.  I really doubt Garmin will go back to display an error or something in 3.2.x

  • I realize that venu2/venu2s require 4.0.0. It's right in my post.

    The point is that you don't get an error unless you run the app. And that "Export Project" appears to work properly. So what would happen if you just add venu2/venu2s without testing, export the project and submit it?

    I wouldn't expect things to work with a 3.2 sim. 

    I never said I expected it to work in the sim. I said I expected the build to fail.

    As I said above:
    Seems like compiler.json for each device should specify a *minimum* SDK version. This was obviously not a problem in the past when each SDK distribution included its own list of supported devices, but it seems like it will be a problem going forward every time a new set of devices is released that is incompatible with older SDKs which nonetheless use the "Device Library" (i.e. CIQ 3.2.x and higher)

    I really doubt Garmin will go back to display an error or something in 3.2.x

    Yeah, but they should, because like I said, it's gonna be an issue every time Garmin adds new devices that have a new minimum SDK .

    At least going forward they could apply the redesign ("minimum SDK version for build") I suggested to future SDKs.

  • Just to reiterate, the main issue (IMO) is that in the past (when each SDK had its own devices), it was impossible to build a new device with an old, unsupported SDK, because the SDK had no device entry for it.

    Now it is possible, and it misleadingly "succeeds".

  • So you are saying for people that don't understand:

    "The Venu® 2/2s is our first Connect IQ product using API level 4.0.0 and requires the Connect IQ 4.0.0 SDK."

    There should be a new 3.2.x SDK with a better error when using a 4.0 device?.

    As far as building an iq with the 4.0 devices using a 3.2 sdk, do you know they don't work for things like watch faces?

    Widgets I can see would be an issue, where 4.0 devices don't have widgets any more -  The get built as device "Super" apps, which is why you need the latest  plugin/extension and SDK to build them correctly

  • There should be a new 3.2.x SDK with a better error when using a 4.0 device?.

    Yes, there should be a better error. The build should fail, and the export project command should fail. When I "edit products" with SDK 3.2, I shouldn't be able to see Venu 2/2S, because 3.2 doesn't support them.

    Imo:

    - Good error = app/system proactively prevents user from making a mistake or shows user an error message as soon as possible. (i.e. User either can't select Venu 2/2S at all for SDK 3.2, or at the very least, the build fails. The user should see an error message as soon possible.)

    - Bad error = app/system allows user to submit invalid input, then lies in wait to show the user a delayed error when they may not be expecting it.

    When device files were packaged with SDKs (before the device library system and new SDK manager were introduced), it was impossible to build new devices with old SDKs. I think that status quo was far superior to this one (IMO).

    If it's not possible or feasible to update the 3.2.x SDK, then newer SDKs should have a better error for future devices which require hypothetical SDK 4.1, 5.x or whatever.

    That's just my opinion. I think the current situation is not dev-friendly.

    Imagine when we're at CIQ SDK 5 or CIQ SDK 6, and for whatever reason, some people are still on CIQ SDK 4 and there's a whole bunch of new devices that won't work with it.

    The alternative is to just tell people "always use the latest SDK", but of course people may not want to do that, for various reasons. I mean there's obviously a reason that the SDK manager allows you to download older versions.... (I'm sure that could change one day, as it did for the old SDK manager.)

  • So you are saying for people that don't understand:

    "The VenuRegistered 2/2s is our first Connect IQ product using API level 4.0.0 and requires the Connect IQ 4.0.0 SDK."

    Think ahead to a few weeks, months or even years in the future. (Assuming 3.2.x is still available to be downloaded then. But then again, they could've downloaded it previously)

    Will that post still be at the top of the announcements forum?

    Think of someone who only updates their SDK very infrequently (we had a thread about that very recently).

    Will they know about this?

  • Why is

    "The Venu® 2/2s is our first Connect IQ product using API level 4.0.0 and requires the Connect IQ 4.0.0 SDK."

    so hard to understand?  It's documented.

  • I addressed that above ^.

  • And again, you are not thinking ahead to when we are at CIQ SDK 5 or 6, and there are multiple new generations of devices, each of which has a minimum SDK that is higher than 3.2, 4, or whatever.

  • Considering that every device has a *max CIQ* which is enforced by the system (if I choose min CIQ = 3.2 in my project options, I lose the ability to build for 935 and several other devices), I don't think it's crazy that each device should also have a *min SDK*, since that's the way it worked in the old system, for all practical purposes.

    It's okay to admit that some things may have room for improvement....