Possible to package without Eclipse?

Former Member
Former Member
I've built a widget using only the command line tools to build the .prg file and run the simulator. But I can't find any documentation on how to build a .iq file without using the Eclipse plugin. Is there no way to do that?

(Things I tried: monkeyc -e option (throws NullPointerException), connectiqpkg (emits deprecation warning and doesn't work).
  • Former Member
    Former Member over 10 years ago
    What does your command look like?

    The building and packaging is all done through the Monkey C (<sdkroot>/bin/monkeyc) command line compiler tool; the Eclipse plug-in simply executes a command line build. If you have the command setup correctly you should be able to package from the plug-in or the command line with the same result. Each time a build occurs in the plug-in the command that's executed is printed to console so you could import your project into Eclipse to see what command is run by the plug-in to test if your command is correct.

    I imported the ActivityTracking sample into Eclipse and ran the package tool. These are the options it's adding to the compiler call:
    -e
    -a C:\connectiq-sdk-win-1.1.0\bin\api.db
    -i C:\connectiq-sdk-win-1.1.0\bin\api.debug.xml
    -o C:\export\ActivityTracker.iq
    -w
    -z C:\ActivityTracking\resources\strings.xml;C:\ActivityTracking\resources\resources.xml;C:\ActivityTracking\resources\bitmaps.xml
    -m C:\ActivityTracking\manifest.xml
    -u C:\connectiq-sdk-win-1.1.0\bin\devices.xml
    -p C:\connectiq-sdk-win-1.1.0\bin\projectInfo.xml
    C:\ActivityTracking\source\ActivityTrackerView.mc C:\ActivityTracking\source\ActivityTracker.mc
  • Former Member
    Former Member over 10 years ago
    Ah, thank you for pasting the command there, I've got it to build now. Knowing it was even possible made a big difference. (I haven't looked at Eclipse at all, so sorry if the above was actually obvious to everyone else...)
  • Former Member
    Former Member over 10 years ago
    In case anyone finds this thread later: the NullPointerException was caused by not having a launcherIcon (d'oh!) [EDIT: no, it was caused by giving the "-o" option a filename without directory], "No packagable products are selected" means the manifest.xml iq:products element should contain the names of real products, not "round_watch", and the command I used can be seen at https://github.com/simonmacmullen/hr-widget/blob/master/package.sh
  • Former Member
    Former Member over 10 years ago
    I'm glad you got things working. You shouldn't be seeing a NullPointerException if you don't provide an icon (the launcher icon is optional so at worst you should see a warning if the -w flag is used when compiling). I'll file a bug report to investigate this. What version of Connect IQ are you compiling with?
  • Former Member
    Former Member over 10 years ago
    Sorry, I was changing so much stuff in an effort to get it to work, that was wrong too :-( I've verified it now. If I do:
    $ monkeyc -e -o bin/HrWidget.iq -w -z resources/strings.xml:resources/bitmaps.xml -m manifest.xml src/HrWidget.mc
    it works, but if I do:
    $ monkeyc -e -o HrWidget.iq -w -z resources/strings.xml:resources/bitmaps.xml -m manifest.xml src/HrWidget.mc
    (i.e. trying to build into the current directory)
    I get:
    Error:null
    usage: monkeyc [-a <arg>] [-b] [-d <arg>] [-e] [-g] [-i <arg>] [-k] [-m
    <arg>]
    [-n <arg>] [-o <arg>] [-p <arg>] [-q] [-r] [-u <arg>] [-w]
    [-x <arg>] [-z
    <arg>]
    -a,--apidb <arg> API import file
    -b,--buildapi Build API output files
    -d,--device <arg> Target device (default: square_watch_sim)
    -e,--package-app Create an application package.
    -g,--debug Print debug output
    -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
    -q,--carray Write output as a C array (deprecated)
    -r,--release Strip debug information
    -u,--devices <arg> devices.xml file to use when compiling
    -w,--warn Show compiler warnings
    -x,--excludes <arg> Add annotations to the exclude list
    -z,--rez <arg> Resource file
    java.lang.NullPointerException
    at com.garmin.monkeybrains.Monkeybrains.packageApplication(Monkeybrains.java:346)
    at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:895)


    This is with Connect IQ 1.1.0 for the Mac.
  • Former Member
    Former Member over 10 years ago
    I've updated the bug report. Thanks for the info.
  • This bug fix was included in the 1.1.2 SDK release.
  • I'm running Windows SDK v1.2.9 and the bug is still there. You must specify a directory for -o app.prg, even if it is just -o .\app.prg

    Otherwise you get Error:null
  • Former Member
    Former Member over 8 years ago
    This issue was raised by a developer yesterday and should be fixed with the next SDK release. The compiler is using Java's File.getParentFile() API which can return null if a relative path doesn't specify a parent.