Getting started - can't build examples (Windows command line)

Former Member
Former Member
I downloaded connectiq-sdk-win-2.4.7.zip as I just wanted to try running some examples and didnt want the full Eclipse experience.

The file:///F:/Garmin/connectiq-sdk-win-2.4.7/ProgrammersGuide.html says that building the examples should be something like

Here is an example of a basic build and run cycle from the command line:
> connectiq // Launch the simulator
> monkeyc -o myApp.prg -f monkey.jungle // Compile the executable
> monkeydo myApp.prg fenix5 // Run in the simulator

The simulator starts up ok but any attempt to compile one of the examples using a comand sequence similar to the above results in:

F:\Garmin\connectiq-sdk-win-2.4.7\samples\BackgroundTimer>monkeyc -o myApp.prg -f monkey.jungle
ERROR: null
java.lang.NullPointerException
at com.garmin.monkeybrains.jungle.JungleManager.getProjectPath(JungleManager.java:379)
at com.garmin.monkeybrains.jungle.JungleManager.getPath(JungleManager.java:728)
at com.garmin.monkeybrains.jungle.JunglePreProcessor.visitInstruction(JunglePreProcessor.java:112)
at com.garmin.monkeybrains.jungle.JunglePreProcessor.visitInstruction(JunglePreProcessor.java:16)
at com.garmin.connectiq.common.antlr.jungle.JungleParser$InstructionContext.accept(JungleParser.java:20 1)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
at com.garmin.connectiq.common.antlr.jungle.JungleBaseVisitor.visitProgram(JungleBaseVisitor.java:20)
at com.garmin.monkeybrains.jungle.JunglePreProcessor.visitProgram(JunglePreProcessor.java:71)
at com.garmin.monkeybrains.jungle.JungleManager.preProcess(JungleManager.java:448)
at com.garmin.monkeybrains.jungle.JungleManager.preProcess(JungleManager.java:428)
at com.garmin.monkeybrains.jungle.JungleManager.<init>(JungleManager.java:193)
at com.garmin.monkeybrains.jungle.JungleManager.<init>(JungleManager.java:229)
at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2327)
at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:270)
at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:253)
at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:299)
usage: monkeyc [-a <arg>] [-b] [-c <arg>] [-d <arg>] [-e] [-f <arg>] [-g] [-h
<arg>] [--hideApi <arg>] [-i <arg>] [-k] [-m <arg>] [-n <arg>] [-o <arg>]
[-p <arg>] [-r] [-s <arg>] [-t] [-u <arg>] [-v] [-w] [-x <arg>] [-y
<arg>] [-z <arg>]
-a,--apidb <arg> API import file
-b,--buildapi Build API output files
-c,--configs-dir <arg> Configuration directory for each device
-d,--device <arg> Target device
-e,--package-app Create an application package.
-f,--jungles <arg> Jungle files
-g,--debug Print debug output
-h,--excludes-map-file <arg>Mapping file of exclusions
--hideApi <arg> Hide API annotations
-i,--import-dbg <arg> Import api.debug.xml
-k,--write-db Write out the api.db file
-m,--manifest <arg> Manifest file
-n,--api-version <arg> The new API version
-o,--output <arg> Output file to create
-p,--project-info <arg> projectInfo.xml file to use when compiling
-r,--release Strip debug information
-s,--sdk-version <arg> SDK version to target
-t,--unit-test Enables compilation of unit tests
-u,--devices <arg> devices.xml file to use when compiling
-v,--version Prints the compiler version
-w,--warn Show compiler warnings
-x,--excludes <arg> Add annotations to the exclude list
-y,--private-key <arg> Private key to sign builds with
-z,--rez <arg> Resource file

I'm clearly missing something obvious since i dont see this being discussed much in the forum.

Any pointers would be much appreciated,

Thanks
Nick
  • I don't do command line builds, but seems you need to specify much more like the device, signing key, etc.
  • I did some experimenting in eclipse and the command line. The immediate problem in your case is that the compiler is not super-smart about retrieving the current project path. You need to use "-f .\monkey.jungle", not "-f monkey.jungle". I'm sure an absolute path would work, as well.

    The second problem, as jim pointed out, is that you will need a private key to sign your build. Once you generate your private developer key, you can build as follows:

    cd CIQSDK\samples\backgroundtimer
    ..\..\bin\monkeyc -y PATH_TO_DEV_KEY -f .\monkey.jungle -o myapp.prg
  • (soapbox on). When you're just starting, installing eclipse and the plugin can help with this kind of thing, as you can see the various common lines used if you want to mainly use command lines build. Also, there are some things that you can only do with eclipse and the plugin, such as the App Settings Editor (test changing options as a user can do with an app from their phone or Garmin Express). There are other things that can be simpler with Eclipse/plugin, such as adding/removing targets/permissions in manifest.xml, setting up a barrel project vs a std app, using those barrels in an app, etc. So when starting, you may want to install Eclipse and the plugin just to get o know the landscape, if nothing more (soapbox off)
  • Former Member
    Former Member
    FlowState Many thanks for your help. Your one post got me up and running.

    jim_m_58 I understand your point. However, as someone who has just arrived in this Ecosystem I am dependent on the documentation and examples to get me started. At this point I am not interested in developing applications I just want to look at some canned examples. Based on the ConnectIQ website and the DeveloperGuide within it, it seemed like command line builds were a supported option and a quick way for me to acheive my immediate goal. Unfortunately it seems that the documentation no longer adequately describes the steps required to achieve a succesful build.

    Just for some background I'm an embedded developer. We have a BLE sports product that we want to add some ANT+ functionality to so we can support Garmin watches and control our device from the users wrist. I'll be using the BLE/ANT+ softdevice on the Nordic nrf52 device to do our end of the connectivity. I'm trying to get my head around what the ConnectIQ SDK offers me at the other end of the link. Right now it looks like ANT+ for talking to sensors and BLE as a backhaul to a phone for Garmin Connect and, possibly, some device specific Application on the phone. I dont *think* ConnectIQ supports BLE to sensors or random connectivity to the Web. Happy to be corrected.

    Regards,
    Nick
  • This was reported and fixed during the ConnectIQ Summit in April. The fix was made for the 3.0 beta, and it was not back-ported to the 2.x SDK.

    Travis
  • Did I miss something? What was fixed? This (the error message) looks very familiar to what I am currently seeing when I try to use Monkey.jungle file to build my app.

    https://forums.garmin.com/forum/developers/connect-iq/1318736-file-overriding
  • If it is similar, Travis indicated it was fixed in the 3.0.0 beta, but not backported to the production 2.4.x SDKs.

    Have you tried the 3.0.0 beta3 to see if you still get the error?