The file 'bin/XXXXX.prg' does not match a compiled application format.

Former Member
Former Member
Environment: OSX Yosemite 10.10.2, MonkeyC Release 1.0.0 (Aikido Monkey)

I have a program that i try to compile with the following:
#!/usr/bin/env bash
monkeyc -o bin/bigheart.prg -w -m manifest.xml -z resources/resources.xml -r source/BigHeartField.mc source/HeartFieldApp.mc source/ScalableTextDrawer.mc source/VirtualDisplay.mc
connectiqpkg -o . -m 'manifest.xml' -n bigheart 'bin/bigheart.prg'


This results in the following error:
MB_HOME: /Users/pure/Software/connect-iq/bin
ERROR: [1] The file 'bin/bigheart.prg' does not match a compiled application format.
org.apache.commons.cli.ParseException: [1] The file 'bin/bigheart.prg' does not match a compiled application format.
at com.garmin.monkeybrains.packager.Packager.validateApplicationArguments(Packager.java:101)
at com.garmin.monkeybrains.packager.Packager.main(Packager.java:434)


I have attached the source code . You can just type:
$ python build.py -p -r --no-sim

or
$ sh simple_build.sh


Sourcecode on github: https://github.com/PerArneng/bigheart
  • Former Member
    Former Member over 10 years ago
    Looking at your code the problem appears to be the name of the prg file you're generating. With the current package tool the name of the prg file must be the part number of the device that the prg was compiled for. You're allowed to pass multiple prg files to the package tool and this is how the package tool knows which prg file is for which device.

    This is a limitation of the current package tool. In the next release it will be easier to use the package tool from the command line as it will be integrated into the compiler (thus eliminating the problem you're seeing). With the next release you'll simply add a -e option to indicate you're packaging the application and the -o option will be a .iq file instead of a .prg file. No device (-d) will need to be provided when using the package app (-e) option as the application will be built for all devices.
  • Former Member
    Former Member over 10 years ago
    Thanks. It works now.

    Now i have a problem with an out of memmory error in the simulator. Created a separate thread for that. I can now start it on the device but it crashes when the exercise starts and i cant figure out why since it can't use the simulator.

    Thanks again