Has the SDK changed so much so I cannot compile my old project?

Hello,

at the and of 2022, I completed development of aviation watch face and app. It worked fine for many years. The development and build was done under Eclipse in Windows and building still works fine in that environment.

recently I installed IQ SDK on Linux as extension to Visual Code. I was trying to fix compilation errors and syntax code for many hours even with Copilot and still I am not able to build.

Has the SDK changed so much so it is not compatible with 2.5 years old code? Is there any migration tool?

Jan

  • I've pushed a pull request to get your app compiling and running without *errors*, using the default type check level. There are still several warnings though.

    I first made the minimum amount of changes to get rid of all errors, then added some "bonus changes":

    - get rid of warnings about deprecated enums

    - get rid of all using statements

    https://github.com/jbrepogmailcom/JansAviatorApp/pull/1

    Make sure to read the comments in the PR about certain functional changes:

    - setEnabledSensors([SENSOR_GENERIC]) was commented out because this causes a crash in the sim. (onSensor is still called in the sim when activity is simulated, with a non-null heading, which would satisfy your use case)

    - get/setProperty was changed to Application.Storage.get/setValue

    To answer your question about why you didn't have all these errors in the past:

    - the main problem, as mentioned above, was the lack of import statements in certain places. I didn't have to change all of your using statements to imports, just add a few key imports

    - some of your code was technically incorrect, although it worked at runtime anyway. I think the type checker became stricter over time to catch some of these issues

    - the type checker also became stricter in other respects, like preventing you from passing an untyped callback method to a function which expects a callback of a certain type (i.e. the arguments and return type of a callback used with Connect IQ api have to be typed now)

    - AppBase.get/setProperty have been fully deprecated now. (As per the comment I added, I don't think they would've worked in your app anyway)

    EDIT: to be clear, even Application.Property.get/setValue would not have worked in your app, since the property in question was not defined in properties.xml. Starting with CIQ 2.4.0, every property that is accessed via those functions has to have a corresponding <property> defined in resource xml

  • As your code seems like it's not normally meant to be public, I will delete my fork once you merge (or reject) the associated pull request.

  • Thank you sir, you are genius! May I please have our permission to keep changes you suggested and keep your fork? I have closed git and made it private.

    Have a great day!

  • Thank you sir, you are genius! May I please have our permission to keep changes you suggested and keep your fork? I have closed git and made it private.

    You're welcome!

    Of course you can keep my changes, that why I made a pull request.