Problems with compatibility with API 3.2 after update to Firmware 27.00

Hello. On IQ store, I have watch compiled with API 3.2, that worked with both Fenix 6X, Tactix Delta, Fenix 7X and Tactix 7. After update to firmware 27.00, users of Tactix 7 and Fenix 7X started to complain that the watch face does not work on their watches.

What is wrong? Did firmware 27.00 broke backwards compatibility with API 3.2 and newer device now require that watchfaces are compiled with API 4.0? In my eclipse configuration, I can still compile with API 3.2 for Tactix 7 and Fenix 7X, but the compiled watch face does not seem to work.

I also compiled with API 4 and sent .prg file to users, but they say Windows does not allow to upload .prg file to watch manually.

Do I need to create second version of my watch face just for Fenix 7X and Tactix 7 and create whole new page in IQ store just for these 2 models?

Jan

  • When you say compiled with “API 3.2 “and “API 4.0” do you mean “SDK 3.2” and “SDK 4.0”?

    As a rule you can (and should) use the latest SDK to compile your apps. (This will work with both new and old devices.) Right now, the latest SDK is 7.3.0.

    As a matter of fact, CIQ 5.0.0 devices (such as Tactix 7 and Fenix 7X) require one of the newer SDKs (at least SDK 7.2.0), but due to an old compiler bug, SDKs >= 5.0.0 and < 7.2.0 (such as SDK 6.2.0) will compile PRGs for those products, although the PRGs may not work properly.

    (CIQ 5.0.1 devices, like Fenix 8, require SDK 7.3.0. In this case, SDKs >= 5.0.1 and < 7.2.0 can incorrectly build for these devices.)

    In my eclipse configuration, I can still compile with API 3.2 for Tactix 7 and Fenix 7X

    If you do mean SDK 3.2, I’m surprised that would actually work, unless that SDK is so old that the version check was not implemented.

    Then again, I tried building for fenix7x with SDK 4.0.6, and it did tell me if have to use a newer SDK.

    So I’m not sure how you would have compiled with “API 4”, unless you don’t actually mean “SDK 4” here.

  • I got somehow confused with API/SDK versions. The manifest in my watch project shows max API 3.2 if I want to compile for Textix Delta and Tactix 7, but when I switch to API 4.0 I am only able to compile for Tactix 7.

    Anyway, my SDK was version 4.1.1.  If I understand well your response, after I update to SDK 7.3.1 I should be able to compile one .prg that runs well on both Tactix Delta, Tactix 7 and Fenix 7X?

    Thanks, Jan

  • Anyway, my SDK was version 4.1.1.

    Then I am indeed surprised that you were able to build for fenix 7X, since it requires CIQ API Level 5, and even with the compiler bug I mentioned above, SDK 4.1.1 won't compile for it. (I just tried it.)

    Have you not opened the SDK manager and updated devices recently?

    Open the following file:

    (Windows) %appdata%\Garmin\ConnectIQ\Devices\fenix7x\compiler.json

    (Mac) ~"/Library/Application Support/Garmin/ConnectIQ/devices/fenix7x/compiler.json"

    Search for connectIQVersion.

    If you have the latest device files, you should see results like "connectIQVersion": 5.0.0

    But in your case I would expect to see something <= 4.1.1.

    In general you should keep your device files up-to-date.

    The manifest in my watch project shows max API 3.2 if I want to compile for Textix Delta and Tactix 7, but when I switch to API 4.0 I am only able to compile for Tactix 7.

    I see. So you were referring to minSdkVersion in the manifest (which is also referred to as "minimum supported API level" - this is closer to its true meaning).

    The manifest in my watch project shows max API 3.2 if I want to compile for Textix Delta and Tactix 7, but when I switch to API 4.0 I am only able to compile for Tactix 7.

    Yeah, that's because Tactix Delta is part of the fenix6pro device, only supports CIQ 3.4.x (lower than 4.0). (See ...\ConnnectIQ\Devices\fenix6xpro\compiler.json)

    In that case:

    • Yes, build with the latest SDK (currently 7.3.1)
    • Set minSdkVersion / "minimum supported API level" in your manifest to either:
      • 1.0.0 (this is the simplest approach that works in all cases, but one of the downsides is it allows you to select devices/products that you may not intend to support)
      • the lowest API level for all devices you intend to support (this is most useful if you know that you need a certain function in the API which only supports API level X, and you want to exclude all devices which don't have X.) In your case, your min API level would have to be at most 3.4.1, assuming you only need to support the 4 devices you mentioned in your post. But I still think it would be easier to use 1.0.0 in this case
    • Always keep your device files up to date (use the auto-update functionality in the sdk manager)
  • Thanks very much for your answers, I really appreciate the effort.

    I have updated to latest SDK and I also set lower API level as you advised. Unfortunately, the watch does not compile, because I think that newer whatch definitions have more strict requirement or the Toybox changed in the meanwhile and is not backwards compatible:

    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\JansAviatorWatch7App.mc:20: Cannot override '$.Toybox.Application.AppBase.getInitialView' with a different return type.
    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\JansAviatorWatchView.mc:765,10: Invalid '$.Toybox.Lang.Number' passed as parameter 4 of type '$.Toybox.Graphics.ArcDirection'.
    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\SunCalc.mc:153,6: Cannot find symbol ':getProperty' on class definition '$.JansAviatorWatchApp'.
    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\SunCalc.mc:166,6: Cannot find symbol ':setProperty' on class definition '$.JansAviatorWatchApp'.
    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\SunCalc.mc:205,4: Cannot assign value '$.Toybox.Lang.String' to member ':min'.

    Unfortunately I do not have time and power to study what is new and why there are errors now if the watch compiled successfully earlier. I give up, no more updates for thousands of users of my watch "Jan's Aviator Watch", fore some of them it stopped working for versions 7 of their hardware.I did on my free time and gave the watch out for free.

    Jan

  • Those are type checking errors. You can disable the type checker for your project by adding the following line to monkey.jungle:

    project.typecheck = 0

  • project.typecheck = 0

    how awesome would it be if this was the default assumption....

    and alternatively, surely it should be easy to detect that the project doesn't use type checking at all... (it could even simply check if there are import statements)

  • I understand that they want the default type checking level to be non-zero, especially for new projects, but it would be nice if they had a way to detect old projects and turn off type checking (with a warning). I have a feeling they want everyone to use type checking though, and I don't blame them.

  • Additionally some of those errors may be significant (meaning that they could indicate a possible problem at runtime):

    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\SunCalc.mc:153,6: Cannot find symbol ':getProperty' on class definition '$.JansAviatorWatchApp'.
    BUILD: ERROR: fenix6xpro: C:\temp\JansAviatorWatch7API5\source\SunCalc.mc:166,6: Cannot find symbol ':setProperty' on class definition '$.JansAviatorWatchApp'.

    These of course refer to the deprecated functions AppBase.getProperty() and AppBase.setProperty() which Garmin has been threatening to remove forever, and which should only be used on older devices which don't support Application.Storage.

    It may very well be that these functions were finally removed in the update to CIQ 5 for devices (although I wouldn't know either way.)

    Here's the dev docs on properties and storage:

    [https://developer.garmin.com/connect-iq/core-topics/persisting-data/]

  • Thanks for advice, I have been able to successfully compile, even with setProperty and getProperty still in the code. I am curious what will users say, if it will work for both Tactix Delta and Tactix 7. When I build only for Tactix 7, I am unable to select API level less than 5.0.x, but when I set API level 3.4 in manifest, the export does build for Tactix 7. Lets see if it will work.

    Because I cannot select API 3.4 to run in simulator for Tactix 7 (only API 5.0), I cannot test final exported built that contains both Tactix Delta and Tacix 7 built with API 3.4

    Jan

  • I have been able to successfully compile, even with setProperty and getProperty still in the code.

    At least run it on Tactix 7 in the simulator. It doesn't matter that the run dialog only allows you to select API level 5, that's to be expected and it's actually what you want bc it matches what will happen on a real device (see below.)

    The error messages I quoted above are big red flags to me, because they suggest that getProperty() and setProperty() may fail at run time on a real device.

    Note that fenix6xpro is a CIQ 3.4.x device. I would be more worried about fenix7x (which includes Tactix 7) since it's a CIQ 5 device. (If they're going to finally remove those functions, it seems likelier for it to happen on the devices with the latest CIQ version.)

    Then again I haven't heard anything about those functions actually being removed (yet), so maybe it's fine.

    Because I cannot select API 3.4 to run in simulator for Tactix 7 (only API 5.0), I cannot test final exported built that contains both Tactix Delta and Tacix 7 built with API 3.4

    Actually you can test all the devices, bc there are two different concepts here:

    • "I set API level 3.4 in manifest": this is the *minimum* API level for the entire build. It only serves 2 purposes:
      • to exclude entire devices from the build
      • to exclude certain part numbers for certain devices from the build (for older devices the Asia-Pacific / APAC part number may have older firmware than the worldwide / WW part, which is why some apps are available for WW versions of an older device, but not APAC versions of the same device.)
    • "Because I cannot select API 3.4 to run in simulator for Tactix 7 (only API 5.0)": When you run a Monkey C project in Eclipse, it asks you to select the API level for the simulated device, which is not the same as the minimum API level in the manifest, nor should it be.

      You don't have to select API 3.4 to run in the simulator because the API level of the device does not have to be equal to the minimum API level for the entire build. In fact, real Tactix 7 devices are guaranteed to have API 5.0 for the latest version that you built (the store won't allow Tactix 7 devices to install this update unless they have firmware with API 5.0.) Furthermore, if you were to use Visual Code to develop your CIQ projects (this is the only supported environment now), the Monkey C extension would not even prompt you for an API level when you run a project in the simulator. Nonetheless, the simulator should run a simulated Tactix 7 as if it has API level 5.0, since that's what the device file specifies.

    For example, consider the following code:

    var settings = System.getDeviceSettings();
    var version = settings.monkeyVersion;
    var versionString = Lang.format("CIQ version: $1$.$2$.$3$", version);
    System.println(versionString);

    If I run it in the simulator for the fenix7x device (which includes Tactix 7), it prints:

    CIQ version: 5.0.0

    If I run it in the simulator for the fenix6xpro device, it prints:

    CIQ version: 3.4.5

    All of this is regardless of the fact that my manifest.xml has a minSdkVersion of 1.2.0. (Again this only serves to potentially exclude devices and part numbers from the build, it does not force any device to use an API level of 1.2.0 at runtime.)

    (Note that I performed these tests in VS Code, which again does not require me to specify an API level when I run a project.)