Under Review
over 2 years ago

bug: compiler 4.1.6 included broken parts of the 4.2.0 Beta 1 with -l 3

I just found that sdk 4.1.6 included parts of 4.2.0 Beta 1 that other bugreports reported recently as breaking some apps. More interestingly this inclusion wasn't mentioned in the announcment on 4.1.6.

See: https://forums.garmin.com/developer/connect-iq/i/bug-reports/sdk-4-2-0-beta-1-won-t-compile-appbase-getproperty

import Toybox.Application;
import Toybox.Application.Properties;

function setConfig(key as PropertyKeyType, val as PropertyValueType) as Void {
    MyApp.setProperty(key, val);
}

java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /home/gavriel/Garmin/ConnectIQ/Sdks/connectiq-sdk-lin-4.1.6-2022-11-04-17f8cfdf3/bin/monkeybrains.jar -o bin/MyApp.prg -f /home/gavriel/Garmin/MyApp/monkey.jungle;/home/gavriel/Garmin/MyApp/barrels.jungle -y /home/gavriel/Garmin/developer_key.der -d fr235_sim -w -l 3

ERROR: fr235: /home/gavriel/Garmin/MyApp/source/Config.mc:17,4: '$.Toybox.Application.AppBase.setProperty' is deprecated.

  • I feel like we've everything we can to help avoid this, and I feel like developers are doing everything they can to ignore us. Please, for the common good, don't ignore us.

    Sorry if this is a stupid question, but how do we avoid using AppBase.setProperty() and AppBase.getProperty() for old devices such as fr235? Are we meant to stop supporting those devices?

    Or should we only use older SDKs to build for those old devices? If so, that would mean either:

    - bifurcating apps to have separate versions for old and new devices

    or

    - hacking the export process to mix and match output from different SDKs

    What's the official recommendation for old devices?

  • Guys,

    The AppBase.setProperty and .getProperty methods have been documented as deprecated in since June 2015. We updated our documentation generator to report deprecated API symbols in a pink/red text area to make it more obvious back in July 2020. We added compiler warnings and errors for deprecated API use in December 2022.

    Please, please, pretty please... stop using these deprecated APIs and transition to the alternatives provided. Leave the warning enabled, and actually do something about it. If there are problems with that transition, let us know so we can fix them. Share code to make it easier for others to migrate. Please.

    I can almost guarantee that deprecated functionality is going to go away at some point, and when it does, apps that continue using removed APIs are going to break. It doesn't matter how popular the app is, how well you know the language, or how good looking you were in your twenties. Your app will crash.

    I feel like we've everything we can to help avoid this, and I feel like developers are doing everything they can to ignore us. Please, for the common good, don't ignore us.

  • Do the target devices you support all use setValue()?.  If so that's an easy fix. The minSDK doesn't determine the devices.  You do that yourself.

    There are only a few devices below the 2.4.0 level where setValue became available.

    Try reading between the lines, or in this case, reading the actual lines in the OP for once:

    ERROR: fr235: /home/gavriel/Garmin/MyApp/source/Config.mc:17,4: '$.Toybox.Application.AppBase.setProperty' is deprecated.

    Why would Gavriel say he "can't remove setProperty()" if he was only building devices that support setValue()? If that were the case, he might say "I don't want to remove setProperty()"

    As usual:

    - You assume OP made an obvious mistake as opposed to Garmin making a poor design decision or having a bug

    - You assume OP knows much less than you do

    - You fail to properly read the original post

    Your next suggestion will be to drop support for fr235 because it's so old.

  • Do the target devices you support all use setValue()?.  If so that's an easy fix. The minSDK doesn't determine the devices.  You do that yourself.

    There are only a few devices below the 2.4.0 level where setValue became available.

  • minSdkVersion="1.2.0", how am I supposed to change/query the settings? I can't remove setProperty!