SDK 8.1 build Issues with API 5.1.x devices?

I have just installed SDK 8.1 having previously been using 7.4.3 up until this point my various watch faces and projects have been compiling and running without any issues.

As part of the installing the new SDK the SDK manager seemed to download new device files as well (this may be key?)

Now when I try to build the watch face for a Descent MK3 43mm device in Visual Studio Code I get an error:

ERROR: descentmk343mm: C:\Users\pbeesley\OneDrive\Personal\eclipse-workspace\GMT4M2\resources-deu\strings\strings.xml: Unable to parse resource file: Invalid byte 1 of 1-byte UTF-8 sequence.

Oddly if I try to do the build in Eclipse I get a different error:

BUILD: ERROR: Unable to parse command line arguments: Unrecognized option: -c

The resource file that it is highlighting as in error in a language file and it does not like the <strings> tag for some reason although nothing ahs changed. In Eclipse it suddenly appears that the -c option to tell it which device the build if for is no longer valid?

If I switch back to SDK 7.4.3 and then build and run for Descent MK3 43mm the watch face works fine once again, although it is using API 5.0.0. When I do a build for Fenix 8, which was previously working, I get the following error: 

ERROR: Device 'fenix843mm' requires API Level '5.1.0'. The current SDK supports up to API Level '5.0.1'. Try updating your SDK using the Connect IQ SDK Manager.

If I use the Eclipse IDE instead then the Descent MK3 build works however I cannot initiate a Fenix8 build as the 'Chose a Target API Level' dropdown is 'blank'.

Any ideas on what to try next or what I might suddenly be doing wrong?

Thanks

  • The 1st two issues seem to be not related to the devices files being updated. The last one is a known issue, there were at least a handful posts about it in the past 2 weeks.

    Eclipse is no longer supported by Garmin, try using VSC.

    I use UTF-8 in my strings and have no problem, but from the error message it looks like you might have a BOM at the beginning of the file. Which editor you used to edit it? Try opening it in a hex editor and see if there's any bytes before the opening '<' and delete them.

    Next: make sure the UTF-8 bytes are correct by using some program or online tool to validate it (maybe by trying to convert it from UTF-8 to another relevant encoding) For German I think it should be ISO-8859-1 for example

  • The last one is a known issue, there were at least a handful posts about it in the past 2 weeks.

    If you mean this:

    > ERROR: Device 'fenix843mm' requires API Level '5.1.0'. The current SDK supports up to API Level '5.0.1'. Try updating your SDK using the Connect IQ SDK Manager.

    It's not a known issue, it's expected behaviour. Several device files (including fenix843mm) were updated so that the main part number has a connectIqVersion (API level) of 5.10, which means you have to use the 8.1.0 SDK to build for it. (Whether or not this device/version check is reasonable / necessary has been endlessly debated, but the check exists.) You can see which API levels are supported for a given compiler by opening COMPILER_FOLDER/bin/compilerinfo.xml and looking at the (misnamed) targetSdkVersions list.

    I know you know all of that, but I thought I'd mention it for context anyway.

    If you mean this:

    > If I use the Eclipse IDE instead then the Descent MK3 build works however I cannot initiate a Fenix8 build as the 'Chose a Target API Level' dropdown is 'blank'.

    Yeah it's related to the fact that Eclipse is no longer supported. In the VS Code Monkey C extension, the target API level is was never even exposed as a build option. And as mentioned below, it has also been removed from the compiler as of SDK 8.1.0. I'm fairly sure I've seen this problem with Eclipse a long time ago, with certain devices/SDKs.

    In Eclipse it suddenly appears that the -c option to tell it which device the build if for is no longer valid?

    The device to build for is actually specified by the -d option (always has been).

    -c is actually the target API level (as mentioned earlier, only used in the Eclipse extension and not the VS Code extension). If you run the 7.4.3 compiler with the -h option, the help says:

    -c,--api-level <arg>              API Level to target (deprecated)

    The 8.1.0 compiler help does not mention this option at all.

    The resource file that it is highlighting as in error in a language file and it does not like the <strings> tag for some reason although nothing ahs change

    If you haven't tracked down the problem yet, would it be possible to post your resource file as an attachment (or at least the part of it that causes the error)?

  • Thanks for the feedback! I will keep searching the forum for feedback on the API level issue.

    The language resource files work with SDK 7.4.3 but not with 8.1 they have not changed. I can't find anything in the 8.1 doco that requires those files to be files to be updated for 8.1?

  • Thanks for the feedback! I will keep searching the forum for feedback on the API level issue.

    There's nothing you can do about it. Eclipse isn't going to work if you use the latest SDK.

    Your only real choice is to switch to VS Code.

    (I would do this anyway, if you have any interest at all in coding outside of Connect IQ / Monkey C. Eclipse has a ton of issues.)

    The language resource files work with SDK 7.4.3 but not with 8.1 they have not changed. I can't find anything in the 8.1 doco that requires those files to be files to be updated for 8.1?

    No, but as flocsy suggested, there may be a problem with your resource file. I don't know why it wouldn't be a problem with earlier SDKs, but if you post the file (or a modified version of it) here, maybe we can try to help you figure it out.

    Try removing as much as possible from one of the files so that your code isn't exposed, but the compilation error still happens, and post it here, if you can.

  • Thanks for your helpl! Yes I have switched to VS Code since I have been using that for other work outside of Garmin for some time so it is good to work in just one IDE now.

    Even if I make the resource file a simple XML document with just the AppName in it and standard character sets it gives me an error

    <strings>
    	<string id="AppName">GMT 4 Master II</string>
    </strings>
    

    ERROR: fenix843mm: C:\Users\pbeesley\OneDrive\Personal\eclipse-workspace\GMT4M2\resources-spa\strings\strings.xml: Unable to parse resource file: Content is not allowed in prolog.

    If I remove support for other languages from the manifest it then builds and runs for Fenix 8.

  • Even if I make the resource file a simple XML document with just the AppName in it and standard character sets it gives me an error

    Are you actually creating a brand new XML file from scratch, or simply editing the existing one?

    I think the problem is def the presence of a BOM at the beginning of the file, like flocsy said. I can recreate this problem by taking a working file and adding EF BB BF to the beginning of the file using a hex editor.

    In my case, the status bar indicates an encoding of "UTF-8 with BOM".

    I think you can either delete the BOM manually, or create a new file from scratch (and copy over the content minus the BOM).

    You could also open the command palette (CMD/CTRL-SHIFT-P) and select Change Encoding > Save With Encoding > UTF-8.

  • I have problem with venu 2...

    1. I can  build and rune app in sim

    Executing task: monkeyc: Building For Device

    java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar [...]connectiq-sdk-win-8.1.0-2025-03-04-7ae1ed1cb\bin\monkeybrains.jar -o bin\PSX6.prg -f [...]PSX-6\monkey.jungle -y [...]developer_key.der -d venu2_sim -w

    WARNING: venu2: The launcher icon (30x30) isn't compatible with the specified launcher icon size of the device 'venu2' (70x70). The image will be scaled to the target size.
    WARNING: venu2: String ID 'Theme' undefined for language 'hun'.
    BUILD SUCCESSFUL

    2. I can't build IQ file

     *  Executing task: monkeyc: Export

    java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar [...]connectiq-sdk-win-8.1.0-2025-03-04-7ae1ed1cb\bin\monkeybrains.jar -o [...]PSX-6.iq -f [...]PSX-6\monkey.jungle -y [...]developer_key.der -e -r -w

    0 OUT OF 4 DEVICES BUILT
    WARNING: wearable2021: The launcher icon (30x30) isn't compatible with the specified launcher icon size of the device 'wearable2021' (70x70). The image will be scaled to the target size.
    WARNING: wearable2021: String ID 'Theme' undefined for language 'hun'.
    ERROR: wearable2021:<-------------------------------  manifest has only one device <iq:product id="venu2"/>

    Why exporter use wearable2021 instead of venu2. There is no problem with other devices?

    I can force to compile by adding wearable2021 in jungle, but I can't add such IQ to sore but I'm not sure if is connected with it

  • Try removing wearable2021 from your SDK's devices/ folder. Either move it away or delete it.

    It does seek like a bug that the compiler is apparently trying to build for a device which isn't present your manifest.

  • Looks like you have "wearable2021" in your manifest.xml, but that's not a real device.  Remove it from your list of target devices

  • there is no any wearable2021 in manifest but if I add <iq:product id="venu2"/> compiler use wearable2021