Aborting launch due to failed build.

Former Member
Former Member

I have been trying to read my way out of this error  message "Aborting launch due to failed build" for a couple of days now, most of the posts are old. Is there a fix or clarity on how to fix this?

I am a novice so KISS. The attached is an extract of the error message. Many Thanks in anticipation. Tony

 

BUILD: -t,--unit-test Enables compilation of unit tests
BUILD: -u,--devices <arg> devices.xml file to use when compiling (deprecated)
BUILD: -v,--version Prints the compiler version
BUILD: -w,--warn Show compiler warnings
BUILD: -x,--excludes <arg> Add annotations to the exclude list
BUILD: -y,--private-key <arg> Private key to sign builds with
BUILD: -z,--rez <arg> Resource file
BUILD: Complete
Aborting launch due to failed build.

  • That looks to be the end of the actual error message that shows the command line parameters.  What are the first messages you see when the compile starts?

  • Former Member
    0 Former Member over 4 years ago in reply to jim_m_58

    Hi Jim, working on windows 10, I have down loaded "Eclipse IDE for Java Developers - 2020-06" with "Java 1.8" and following this tutorial "https://www.google.com/search?q=connect+iq+sdk+tutorial&rlz=1C1CHBF_en-GBGB859GB859&oq=connect+iq+sdk&aqs=chrome.3.69i59l2j0l3j69i60l3.9604j0j7&sourceid=chrome&ie=UTF-8#kpvalbx=_v15HX86MOZWp1fAP4ZmmkAE19

    My initial aim is to build a simple watch face to test it works, connect iq builds the script, I can load up the simulator which is blank, but when I "run as" "connect iq app" I get the following :- 

    New devices are available! Reload Devices
    ======================================================
    BUILD: C:\Program Files\Java\jre1.8.0_261\bin\java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:\Users\tony\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-3.2.1-2020-08-20-56ff593b7\bin\monkeybrains.jar -o "D:\Eclipse\Watch face\bin\Watch face.prg" -w -y D:\Eclipse\Test\.project -f "D:\Eclipse\Watch face\monkey.jungle"
    BUILD: ERROR: java.security.InvalidKeyException: invalid key format
    BUILD: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format
    BUILD: at sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(Unknown Source)
    BUILD: at java.security.KeyFactory.generatePrivate(Unknown Source)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:127)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:106)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:91)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:55)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2400)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:252)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:281)
    BUILD: Caused by: java.security.InvalidKeyException: invalid key format
    BUILD: at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
    BUILD: at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
    BUILD: at sun.security.rsa.RSAPrivateCrtKeyImpl.<init>(Unknown Source)
    BUILD: at sun.security.rsa.RSAPrivateCrtKeyImpl.newKey(Unknown Source)
    BUILD: at sun.security.rsa.RSAKeyFactory.generatePrivate(Unknown Source)
    BUILD: ... 9 more
    BUILD: usage: monkeyc [-a <arg>] [-d <arg>] [-e] [--Eno-invalid-symbol] [-f <arg>] [-g]
    BUILD: [-h] [-i <arg>] [-m <arg>] [-o <arg>] [-p <arg>] [-r] [-s <arg>] [-t] [-u
    BUILD: <arg>] [-v] [-w] [-x <arg>] [-y <arg>] [-z <arg>]
    BUILD: -a,--apidb <arg> API import file
    BUILD: -d,--device <arg> Target device
    BUILD: -e,--package-app Create an application package.
    BUILD: --Eno-invalid-symbolDo not error when a symbol is found to be invalid
    BUILD: -f,--jungles <arg> Jungle files
    BUILD: -g,--debug Print debug output
    BUILD: -h,--help Prints help information
    BUILD: -i,--import-dbg <arg> Import api.debug.xml
    BUILD: -m,--manifest <arg> Manifest file
    BUILD: -o,--output <arg> Output file to create
    BUILD: -p,--project-info <arg>projectInfo.xml file to use when compiling
    BUILD: -r,--release Strip debug information
    BUILD: -s,--sdk-version <arg> SDK version to target
    BUILD: -t,--unit-test Enables compilation of unit tests
    BUILD: -u,--devices <arg> devices.xml file to use when compiling (deprecated)
    BUILD: -v,--version Prints the compiler version
    BUILD: -w,--warn Show compiler warnings
    BUILD: -x,--excludes <arg> Add annotations to the exclude list
    BUILD: -y,--private-key <arg> Private key to sign builds with
    BUILD: -z,--rez <arg> Resource file
    BUILD: Complete
    ======================================================
    BUILD: C:\Program Files\Java\jre1.8.0_261\bin\java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:\Users\tony\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-3.2.1-2020-08-20-56ff593b7\bin\monkeybrains.jar -o "D:\Eclipse\Watch face\bin\Watch face.prg" -w -y D:\Eclipse\Test\.project -f "D:\Eclipse\Watch face\monkey.jungle"
    BUILD: ERROR: java.security.InvalidKeyException: invalid key format
    BUILD: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format
    BUILD: at sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(Unknown Source)
    BUILD: at java.security.KeyFactory.generatePrivate(Unknown Source)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:127)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:106)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:91)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:55)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2400)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:252)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:281)
    BUILD: Caused by: java.security.InvalidKeyException: invalid key format
    BUILD: at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
    BUILD: at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
    BUILD: at sun.security.rsa.RSAPrivateCrtKeyImpl.<init>(Unknown Source)
    BUILD: at sun.security.rsa.RSAPrivateCrtKeyImpl.newKey(Unknown Source)
    BUILD: at sun.security.rsa.RSAKeyFactory.generatePrivate(Unknown Source)
    BUILD: ... 9 more
    BUILD: usage: monkeyc [-a <arg>] [-d <arg>] [-e] [--Eno-invalid-symbol] [-f <arg>] [-g]
    BUILD: [-h] [-i <arg>] [-m <arg>] [-o <arg>] [-p <arg>] [-r] [-s <arg>] [-t] [-u
    BUILD: <arg>] [-v] [-w] [-x <arg>] [-y <arg>] [-z <arg>]
    BUILD: -a,--apidb <arg> API import file
    BUILD: -d,--device <arg> Target device
    BUILD: -e,--package-app Create an application package.
    BUILD: --Eno-invalid-symbolDo not error when a symbol is found to be invalid
    BUILD: -f,--jungles <arg> Jungle files
    BUILD: -g,--debug Print debug output
    BUILD: -h,--help Prints help information
    BUILD: -i,--import-dbg <arg> Import api.debug.xml
    BUILD: -m,--manifest <arg> Manifest file
    BUILD: -o,--output <arg> Output file to create
    BUILD: -p,--project-info <arg>projectInfo.xml file to use when compiling
    BUILD: -r,--release Strip debug information
    BUILD: -s,--sdk-version <arg> SDK version to target
    BUILD: -t,--unit-test Enables compilation of unit tests
    BUILD: -u,--devices <arg> devices.xml file to use when compiling (deprecated)
    BUILD: -v,--version Prints the compiler version
    BUILD: -w,--warn Show compiler warnings
    BUILD: -x,--excludes <arg> Add annotations to the exclude list
    BUILD: -y,--private-key <arg> Private key to sign builds with
    BUILD: -z,--rez <arg> Resource file
    BUILD: Complete
    New devices are available! Reload Devices
    ======================================================
    BUILD: C:\Program Files\Java\jre1.8.0_261\bin\java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:\Users\tony\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-3.2.1-2020-08-20-56ff593b7\bin\monkeybrains.jar -o "D:\Eclipse\Watch face\bin\Watch face.prg" -w -y D:\Eclipse\Test\.project -d vivoactive3_sim -s 3.0.0 -f "D:\Eclipse\Watch face\monkey.jungle"
    BUILD: ERROR: java.security.InvalidKeyException: invalid key format
    BUILD: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format
    BUILD: at sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(Unknown Source)
    BUILD: at java.security.KeyFactory.generatePrivate(Unknown Source)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:127)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:106)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:91)
    BUILD: at com.garmin.connectiq.common.signing.KeyUtils.getPrivateKey(KeyUtils.java:55)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2400)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:252)
    BUILD: at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:281)
    BUILD: Caused by: java.security.InvalidKeyException: invalid key format
    BUILD: at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
    BUILD: at sun.security.pkcs.PKCS8Key.decode(Unknown Source)
    BUILD: at sun.security.rsa.RSAPrivateCrtKeyImpl.<init>(Unknown Source)
    BUILD: at sun.security.rsa.RSAPrivateCrtKeyImpl.newKey(Unknown Source)
    BUILD: at sun.security.rsa.RSAKeyFactory.generatePrivate(Unknown Source)
    BUILD: ... 9 more
    BUILD: usage: monkeyc [-a <arg>] [-d <arg>] [-e] [--Eno-invalid-symbol] [-f <arg>] [-g]
    BUILD: [-h] [-i <arg>] [-m <arg>] [-o <arg>] [-p <arg>] [-r] [-s <arg>] [-t] [-u
    BUILD: <arg>] [-v] [-w] [-x <arg>] [-y <arg>] [-z <arg>]
    BUILD: -a,--apidb <arg> API import file
    BUILD: -d,--device <arg> Target device
    BUILD: -e,--package-app Create an application package.
    BUILD: --Eno-invalid-symbolDo not error when a symbol is found to be invalid
    BUILD: -f,--jungles <arg> Jungle files
    BUILD: -g,--debug Print debug output
    BUILD: -h,--help Prints help information
    BUILD: -i,--import-dbg <arg> Import api.debug.xml
    BUILD: -m,--manifest <arg> Manifest file
    BUILD: -o,--output <arg> Output file to create
    BUILD: -p,--project-info <arg>projectInfo.xml file to use when compiling
    BUILD: -r,--release Strip debug information
    BUILD: -s,--sdk-version <arg> SDK version to target
    BUILD: -t,--unit-test Enables compilation of unit tests
    BUILD: -u,--devices <arg> devices.xml file to use when compiling (deprecated)
    BUILD: -v,--version Prints the compiler version
    BUILD: -w,--warn Show compiler warnings
    BUILD: -x,--excludes <arg> Add annotations to the exclude list
    BUILD: -y,--private-key <arg> Private key to sign builds with
    BUILD: -z,--rez <arg> Resource file
    BUILD: Complete
    Aborting launch due to failed build.

  • Is your developer key configured properly? Looking at this, -y parameter should probably have your key file, but now it is this:

    -y D:\Eclipse\Test\.project

  • Yes, that looks like the problem to me.  It's not actually a key.

  • Former Member
    0 Former Member over 4 years ago in reply to Kurev

    I have just regenerated the developer Key, now working Many Thanks....... Tony