Ticket Created
over 3 years ago

CIQQA-864

java.lang.NullPointerException while compiling on Kubuntu 21.10 with newer SDK's

This is some issue I experience for some time. Atm, I use Kubuntu 21.10 but I had it in previous versions too. First I need to search and install many packages due to old Ubuntu dependencies. Later I install Eclipse, plugin, SDK etc. SDK 3.1.9 works fine and I can compile and run an app from Eclipse. However, it's old and it doesn't support lots of newer devices. So I install any later SDK via SDK manager and install all the devices. However, it doesn't compile then. I tried Visual Studio Code instead of Eclipse and also tried to run the command inside the terminal. I only got a NullPointerException with some DevicesJsonReader.java file.

A try with a watchface sample named DenemeVC:

Executing task in folder DenemeVC: /home/sis651/JAVA/jre1.8.0_311/bin/java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /home/sis651/.Garmin/ConnectIQ/Sdks/connectiq-sdk-lin-4.0.7-2021-11-29-437ff4cc4/bin/monkeybrains.jar -o /home/sis651/DEV/workspace/DenemeVC/DenemeVC.prg -f /home/sis651/DEV/workspace/DenemeVC/monkey.jungle -y /home/sis651/DEV/ConnectIQSDK/developer_key.der -w -d d2charlie -r <

ERROR: null
java.lang.NullPointerException
at com.garmin.connectiq.common.devices.DevicesJsonReader.parseResolution(DevicesJsonReader.java:584)
at com.garmin.connectiq.common.devices.DevicesJsonReader.loadDeviceFromElement(DevicesJsonReader.java:398)
at com.garmin.connectiq.common.devices.DevicesJsonReader.read(DevicesJsonReader.java:321)
at com.garmin.connectiq.common.devices.DevicesJsonReader.read(DevicesJsonReader.java:304)
at com.garmin.connectiq.common.devices.DevicesJsonReader.read(DevicesJsonReader.java:302)
at com.garmin.monkeybrains.devices.DeviceManager.readStreamIntoDevicesJsonReader(DeviceManager.java:48)
at com.garmin.monkeybrains.devices.DeviceManager.<init>(DeviceManager.java:71)
at com.garmin.monkeybrains.Monkeybrains.loadDeviceManager(Monkeybrains.java:438)
at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2490)
at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:339)
at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:368)
usage: monkeyc [-a <arg>] [-b <arg>] [-c <arg>] [-d <arg>] [-e]
[--Eno-invalid-symbol] [-f <arg>] [-g] [-h] [-i <arg>] [-l <arg>] [-m
<arg>] [-o <arg>] [-p <arg>] [-r] [-s <arg>] [-t] [-u <arg>] [-v] [-w]
[-x <arg>] [-y <arg>] [-z <arg>]...

I had tried to dig it a bit more and I remember it was about something like sizeKey is missing somewhere. 3.1.9 works fine, but anything later results in the same NullPointerException. It happens with all my apps and devices I choose.

Anyone has an idea?

Parents
  • Ok, I've found the issue.

    The compiler does not like that your system is in Turkish.

    I've been able to reproduce your problem.

    You need to "unset" the language before calling the compiler like:

    LANG=C /home/jeansch/.Garmin/ConnectIQ/Sdks/connectiq-sdk-lin-4.0.9-2022-01-24-2154651d3/bin/monkeyc --jungles monkey.jungle --device fenix6 --output AnalogWatch.prg --private-key key.der --warn

    Or, you can edit the monkeyc script and set the lang inside:

    #!/bin/bash

    export LANG=C
    MB_HOME="$( cd "$( dirname "$0" )" && pwd )"
    java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -classpath "$MB_HOME"/monkeybrains.jar com.garmin.monkeybrains.Monkeybrains "$@"

Comment
  • Ok, I've found the issue.

    The compiler does not like that your system is in Turkish.

    I've been able to reproduce your problem.

    You need to "unset" the language before calling the compiler like:

    LANG=C /home/jeansch/.Garmin/ConnectIQ/Sdks/connectiq-sdk-lin-4.0.9-2022-01-24-2154651d3/bin/monkeyc --jungles monkey.jungle --device fenix6 --output AnalogWatch.prg --private-key key.der --warn

    Or, you can edit the monkeyc script and set the lang inside:

    #!/bin/bash

    export LANG=C
    MB_HOME="$( cd "$( dirname "$0" )" && pwd )"
    java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -classpath "$MB_HOME"/monkeybrains.jar com.garmin.monkeybrains.Monkeybrains "$@"

Children
  • Aah, thanks. In the past I had some problems with Turkish language in Garmin Connect app. In order to change Connect IQ app settings I had to change the language to English. Otherwise, while changing settings it crashed.

    Thanks for the help. I'll check it.