monkeyc throws NullPointerException when PushNotification permission is specified

Former Member
Former Member
I just installed the Connect IQ Eclipse plug-in and the latest SDK (3.0.1) and tried to build the default monkey app created with the Project Wizard.

The parameters I used were:
- Project Type: Watch App
- App Version: 0.0.1
- Minimal SDK: 1.4.x
- Template: Simple
- Supported Devices: Forerunner 230
- Languages: English, Dutch
- Permissions: <all>

When trying to build this, I received an exception:

BUILD: /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/kris/Development/Software/garmin/connectiq-sdk-mac-3.0.1/bin/monkeybrains.jar -o /Users/kris/Development/Workspaces/Garmin/GestureAnalyser/bin/GestureAnalyser.prg -w -y /Users/kris/Development/Workspaces/Garmin/garmin_key.der -f /Users/kris/Development/Workspaces/Garmin/GestureAnalyser/monkey.jungle
BUILD: java.lang.NullPointerException
BUILD: at com.garmin.monkeybrains.asm.SymbolTable.getEntry(SymbolTable.java:47)
BUILD: at com.garmin.monkeybrains.asm.PermissionEntry.resolve(PermissionEntry.java:60)
BUILD: at com.garmin.monkeybrains.asm.Assembler.resolve(Assembler.java:1176)
BUILD: at com.garmin.monkeybrains.asm.Assembler.resolve(Assembler.java:973)
BUILD: at com.garmin.monkeybrains.asm.Assembler.assemble(Assembler.java:650)
BUILD: at com.garmin.monkeybrains.compiler.Compiler.assemble(Compiler.java:1402)
BUILD: at com.garmin.monkeybrains.ProjectBuilder.assembleProject(ProjectBuilder.java:649)
BUILD: at com.garmin.monkeybrains.Monkeybrains.runPRGCompiler(Monkeybrains.java:1399)
BUILD: at com.garmin.monkeybrains.Monkeybrains.compileApplication(Monkeybrains.java:1002)
BUILD: at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2199)
BUILD: at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:252)
BUILD: at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:234)
BUILD: at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:281)
BUILD: ERROR: unknown:0: null
BUILD: Complete


I tried to manually build it at the command line:

monkeyc -o ./bin/GestureAnalyser.prg -y ../garmin_key.der -f ./monkey.jungle

But that gave the same exception.

The only reference I found about this exception was a post in this forum about an [FONT=courier new]Ant[/FONT] permission problem: https://forums.garmin.com/forum/deve...ission-problem

So I tried removing some permissions, and finally I found that in my case it wasn't the [FONT=courier new]Ant[/FONT] permission, but the [FONT=courier new]PushNotification[/FONT] permission that caused the trouble. So when I removed that permission from the [FONT=courier new]manifest.xml[/FONT] file, the compiler was able to build the code successfully.
  • I'm wondering if Push Notifications made it into 3.0.1. In the Announcement for 3.0.1 I don't see it mentioned, and don't see it in the Programmer's guide or API documentation.

    From a developer blog post in june, it says
    • Messaging – For select developers, we are opening the potential for their CIQ apps to get actionable notifications. These developers will be able to push content from their service to a specific device using Garmin’s new push notification service.

    Are you trying to use it in your app? Do you need the permission? And with the 235 being on CIQ1 and this being a CIQ3 function, it could be something with that. Have you tried it on a CIQ3 target like the fenix 5?
  • Did you start with the template and just enable all permissions? (you mentioned the ANT permission) Generally, you want to start with none or ones you know you'll need for sure, and build up from there as you add code that needs the permission, as the permissions requested show up in the app store for your app, and the user must OK them when downloading. Some of my more advanced apps only use 3-4 permissions, while others might have 0-2.

    This error shouldn't happen, but it's easy to avoid.
  • Former Member
    Former Member
    Hey All,

    This was not meant to be put into the permission options yet. I've got a ticket to have it removed until it is available.

    Thanks,
    - Coleman
  • Former Member
    Former Member
    Thanks for responding Jim and Coleman. @Jim: I did indeed just tick all permissions in the eclipse plugin without thinking. It was merely a first try to get started and fiddle around with the SDK. So you are right it's easy to avoid. But it's anyway a bug, so I reported it :-) @Coleman: okay, thanks!

    PS: sorry for the late reply, but I expected the forum to mail me on a reaction, but it didn't.
  • I just looked and this seems to be fixed in the 3.0.3 SDK.
  • Former Member
    Former Member
    Jim is correct. This has been addressed.