BUILD: ERROR: Cannot read the array length because " " is null

Since yesterday I get the message "BUILD: ERROR: Cannot read the array length because "<local3>" is null" in the console of Eclipse. It happens with any datafield that I try.

It is with SDK 3.2.5 and 4.0.1. My suspicion is that my Eclipse setup is the problem. I can build the same datafields on a different PC just fine.

I can't find a other report on this. Probably just a question of removing Eclipse?

  • I have removed Eclipse and installed again, but the problem persists. Is there an option to debug this? I have no variable called local3

  • Is is a message while running your app?  Sounds like it.  Maybe add a null check where you use size()?

    if(myvar!=null && myvar.size()>3) {

    }

    Do you see a stack trace with a line number?

  • The app (datafield) runs fine from Eclipse within Windows. The problem occurs with building. The first lines of the console output in Eclipse:

    BUILD: C:\Program Files\Java\jdk-15\bin\java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:\Users\Joop\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-4.0.2-2021-05-13-9b3b7f19f\bin\monkeybrains.jar -o "Z:\Documents\Softwareontwikkeling\Garmin IQ ontwikkeling\Versies\DU8-10c0.iq" -e -w -y C:\CIQ-sdk\developer_key -r -f C:\Users\Joop\git\DR8-10c0\DR8-10c0\monkey.jungle
    BUILD: ERROR: Cannot read the array length because "<local3>" is null
    BUILD: java.lang.NullPointerException: Cannot read the array length because "<local3>" is null
    BUILD:     at com.garmin.monkeybrains.Monkeybrains.delete(Monkeybrains.java:724)
    BUILD:     at com.garmin.monkeybrains.Monkeybrains.delete(Monkeybrains.java:725)
    BUILD:     at com.garmin.monkeybrains.Monkeybrains.packageApplication(Monkeybrains.java:1022)
    BUILD:     at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2620)
    BUILD:     at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:322)
    BUILD:     at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:351)
    I can build the iq-file fine on another PC, so it seems to be related more to the environment then to the code. That's why I reinstalled Eclipse.

    I have checked the paths in the build command; all files and directories are available.

    I will reinstall the SDK manager. Maybe that that helps.

  • Maybe somwthing odd in your manifest.xml, or in the device files?

    One of the "upcoming" devices from a while back?

  • I found it. For some reason building the iq-file on my server doesn't work anymore: "Z:\Documents\Softwareontwikkeling\Garmin IQ ontwikkeling\Versies\DU8-10c0.iq"

    When I choose a location on this PC it builds fine. I haven't changed rights, I can delete existing iq-files in the specified directory on my server.

    Thanks for helping.