ERROR: null when compiling with SDK8.1.0 under windows11 for a lot of device

Some big projets have a compilation problem with sdk 8.1 but it's good with 7.4.3.

Executing task: monkeyc: Building For Device

java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar c:\Users\Parents\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-8.1.0-2025-03-04-7ae1ed1cb\bin\monkeybrains.jar -o bin\APP4PARAGLIDNEW.prg -f c:\Users\Parents\workspace\APP4PARAGLIDNEW\monkey.jungle -y C:\Users\Parents\workspace\developer_key\developer_key -d fenix7x_sim -w -l 0 -O 3 --debug-log-level 3 --debug-log-output c:\Users\Parents\workspace\APP4PARAGLIDNEW\bin\log.zip --warn --build-stats 0 --typecheck 3 --optimization 3p

ERROR: null

* The terminal process terminated with exit code: 100.
* Terminal will be reused by tasks, press any key to close it.

When I include some trace in compilation I have this in file Error.txt

Exceptions: 1
null

java.lang.NullPointerException
at com.garmin.monkeybrains.compiler2.ir.namespace.Namespace$ExcludedContext.update(Namespace.java:154)
at com.garmin.monkeybrains.compiler2.ir.namespace.Namespace.addExcluded(Namespace.java:1054)
at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitClassStatements(ModuleVisitor.java:1400)
at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitClassDefinition(ModuleVisitor.java:1569)
at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitModuleStatement(ModuleVisitor.java:1715)
at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitModuleStatements(ModuleVisitor.java:969)
at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitTopLevel(ModuleVisitor.java:1456)
at com.garmin.monkeybrains.compiler2.SemanticAnalyzer.runSemanticAnalysis(SemanticAnalyzer.java:366)
at com.garmin.monkeybrains.compiler2.project.ProjectBuilder.runSemanticAnalysis(ProjectBuilder.java:713)
at com.garmin.monkeybrains.compiler2.project.ProjectBuilder.runSemanticAnalysis(ProjectBuilder.java:613)
at com.garmin.monkeybrains.compiler2.Compiler2.build(Compiler2.java:1780)
at com.garmin.monkeybrains.compiler2.Compiler2.buildProject(Compiler2.java:979)
at com.garmin.monkeybrains.Monkeybrains.runCompiler2(Monkeybrains.java:1669)
at com.garmin.monkeybrains.Monkeybrains.compileApplication(Monkeybrains.java:1639)
at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2305)
at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:295)
at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:345)
Compiler Warnings: 17
WARNING: fenix7x: String ID 'WPLATS' undefined for language 'deu'.
WARNING: fenix7x: String ID 'fitUnitsLabel' undefined for language 'deu'.
WARNING: fenix7x: String ID 'fitDataLabel' undefined for language 'deu'.
WARNING: fenix7x: String ID 'OFFSETPlus' undefined for language 'deu'.
WARNING: fenix7x: String ID 'OFFSETMoins' undefined for language 'deu'.
WARNING: fenix7x: String ID 'VERSION' undefined for language 'deu'.
WARNING: fenix7x: String ID 'fitTitleLow' undefined for language 'deu'.
WARNING: fenix7x: String ID 'WPICAO' undefined for language 'deu'.
WARNING: fenix7x: String ID 'WPLONS' undefined for language 'deu'.
WARNING: fenix7x: String ID 'MsgFV0' undefined for language 'fre'.
WARNING: fenix7x: C:\Users\Parents\workspace\APP4PARAGLIDNEW\source\GenView.mc:3310,3: Local variable 'tStop' is not used.
WARNING: fenix7x: C:\Users\Parents\workspace\APP4PARAGLIDNEW\source\GenView.mc:5278,7: Local variable 'YStart' is not used.
WARNING: fenix7x: C:\Users\Parents\workspace\APP4PARAGLIDNEW\source\GenView.mc:5406,2: Local variable 'ampm' is not used.
WARNING: fenix7x: C:\Users\Parents\workspace\APP4PARAGLIDNEW\source\GenView.mc:5406,2: Local variable 'ampm2' is not used.
WARNING: fenix7x: c:\Users\Parents\workspace\APP4PARAGLIDNEW\monkey.jungle:91: Resource path 'C:\Users\Parents\workspace\APP4PARAGLIDNEW\resources-round-280x280\images\Paraglid\fonts.xml' already exists in the resource path. These resources will be overriden with higher precedence.
WARNING: fenix7x: c:\Users\Parents\workspace\APP4PARAGLIDNEW\monkey.jungle:91: Resource path 'C:\Users\Parents\workspace\APP4PARAGLIDNEW\resources-Applicatives\Paraglid\propertiesParaglid.xml' already exists in the resource path. These resources will be overriden with higher precedence.
WARNING: fenix7x: c:\Users\Parents\workspace\APP4PARAGLIDNEW\monkey.jungle:91: Resource path 'C:\Users\Parents\workspace\APP4PARAGLIDNEW\resources-Applicatives\Paraglid\stringApp4Trail.xml' already exists in the resource path. These resources will be overriden with higher precedence.

It's good for old device like Fenix 3 HR with perhaps less code , variables and perhaps exclusions.

Without any change, when I select SDK 743 all is good

  • When I compile with unreleased version 8.0.0 all compilations are good too. Only the issue with 8.1.0

    When I try to export with Eclipse (more information in the log)  

    BUILD: 0 OUT OF 194 DEVICES BUILT
    BUILD: ERROR: Cannot invoke "java.util.Set.add(Object)" because "this.mFileInfo" is null

    When I see in class code in line 154   this.mFileInfo.add(fileInfo);

  • Fixed.

    Solution

    In big application using a lot of exclusion for devices, 

    I had a class for instintct and a class for other.

    (:CIQ2HighMemory :MULTICOLOR)  class MsgScreen extends WatchUi.View like this
    and an another class
    (:CIQ2HighMemory :BICOLOR)  class MsgScreen extends WatchUi.View
    In this case when I compiled I had null and 
    Exceptions: 1
    null

    java.lang.NullPointerException
    at com.garmin.monkeybrains.compiler2.ir.namespace.Namespace$ExcludedContext.update(Namespace.java:154)
    at com.garmin.monkeybrains.compiler2.ir.namespace.Namespace.addExcluded(Namespace.java:1054)
    at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitClassStatements(ModuleVisitor.java:1400)
    at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitClassDefinition(ModuleVisitor.java:1569)
    at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitModuleStatement(ModuleVisitor.java:1715)
    at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitModuleStatements(ModuleVisitor.java:969)
    at com.garmin.monkeybrains.compiler2.ir.visitors.ModuleVisitor.visitTopLevel(ModuleVisitor.java:1456)
    at com.garmin.monkeybrains.compiler2.SemanticAnalyzer.runSemanticAnalysis(SemanticAnalyzer.java:366)
    at com.garmin.monkeybrains.compiler2.project.ProjectBuilder.runSemanticAnalysis(ProjectBuilder.java:713)
    at com.garmin.monkeybrains.compiler2.project.ProjectBuilder.runSemanticAnalysis(ProjectBuilder.java:613)
    at com.garmin.monkeybrains.compiler2.Compiler2.build(Compiler2.java:1780)
    at com.garmin.monkeybrains.compiler2.Compiler2.buildProject(Compiler2.java:979)
    at com.garmin.monkeybrains.Monkeybrains.runCompiler2(Monkeybrains.java:1669)
    at com.garmin.monkeybrains.Monkeybrains.compileApplication(Monkeybrains.java:1639)
    at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2305)
    at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:295)
    at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:345)
    This was fine in SDK 743 or beta 8.0, but not in version 8.1.0.

    I simply changed the class name to:

    (:BICOLOR) class MsgScreenBicolor extends WatchUi.View

    and adapted my code to call the MsgScreenBicolor class for Instinct devices and MsgScreen for other watches.

    It's likely that the exclude doesn't have enough space to correctly apply the exclude, as there are many exclusions in the code.

    Fixed now
  • You might want to post a bug report about this. Garmin might reply and give you an email address so you can send them a copy of the broken version of your project (if you're comfortable doing that), assuming you don't want to post it publicly.

    Unless ofc you can recreate this with a smaller version of your code that you're comfortable with posting.

  • You can email the compiler log (--debug-log-level 3) to [email protected]