Android: Failure [INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING]

What would cause this error message?

This is what I’m getting in my terminal…

client-75-102-97-42:~ Dan$ /Users/Dan/Desktop/adt-bundle-mac-x86_64/sdk/platform-tools/adb -d install /Users/Dan/Desktop/gameName.apk
1306 KB/s (10373435 bytes in 7.754s)
pkg: /data/local/tmp/gameName.apk
Failure [INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING]

I am building for a device and not an emulator and just would like to test using the debug keystore.
I seem to missing the jarsigner and keytool utility files from my android sdk.
Any quick help would be very much appreciated!

DY [import]uid: 93901 topic_id: 35574 reply_id: 335574[/import]

No ideas?? [import]uid: 93901 topic_id: 35574 reply_id: 141909[/import]

It sounds like your APK is being digitally signed by the JDK 7 instead of the JDK 6, which signs with an encryption that Android does not support. Android only supports the JDK 6.

I suggest that you downgrade your from JDK 7 to 6 according to Apple instructions here…
http://support.apple.com/kb/HT5559?viewlocale=en_US&locale=en_US

Then re-build your APK with the Corona Simulator and re-install it to your Android device. [import]uid: 32256 topic_id: 35574 reply_id: 141932[/import]

Also, you can verify which version of Java you are running by typing in the following using the Mac’s Terminal window:
[lua]
java -version
[/lua]

If it returns version 1.7, then that’s the reason why it is signed wrong.
Android only supports Java version 1.6 (aka: Java 6). [import]uid: 32256 topic_id: 35574 reply_id: 141933[/import]

It looks like I have 1.6.0_37. That should then work, correct? I have my project folder subdivided into folders for images and scripts. Would this cause any problems? [import]uid: 93901 topic_id: 35574 reply_id: 141937[/import]

Would you mind trying to sign the APK yourself? This is to verify that jarsigner works on your machine, because it sounds like it should. Just type in the following at the Terminal window…
[lua]
jarsigner -keystore “./CoronaSDK/Resource Library/Android/debug.keystore” androiddebugkey
[/lua]

After running the above, the jarsigner tool will ask for a password. The password for Corona’s debug.keystore file is “android”.

Next, try to install your APK onto your Android device. If it installs correctly, then it sounds like the Corona Simulator is signing it wrong. If it does not install, then we’re having a problem with the jarsigner tool. [import]uid: 32256 topic_id: 35574 reply_id: 141988[/import]

This is the error I got when I tried that…
dyosuas-macbook:~ Dan$ jarsigner -keystore “./CoronaSDK/Resource Library/Android/debug.keystore” /Users/Dan/Desktop/myGame.apk androiddebugkey

Enter Passphrase for keystore:

jarsigner error: java.lang.RuntimeException: keystore load: /Users/Dan/CoronaSDK/Resource Library/Android/debug.keystore (No such file or directory)
After attempting to install I obviously got the original error again. So an issue with the jarsigner tool then? [import]uid: 93901 topic_id: 35574 reply_id: 142018[/import]

Your path to the debug.keystore file is wrong. You need to set path…
>> “./CoronaSDK/Resource Library/Android/debug.keystore”
…to where you Corona SDK is located. [import]uid: 32256 topic_id: 35574 reply_id: 142046[/import]

Sorry, I’m not so good with the terminal… One of those slashes was a backslash. Says, warning: the signer certificate has expired. [import]uid: 93901 topic_id: 35574 reply_id: 142048[/import]

>> Says, warning: the signer certificate has expired.

Corona’s “debug.keystore” has actually expired, so that’s okay and normal. That warning won’t prevent an Android device from installing the APK; only prevents you from publishing it. So, go ahead and try to install it on your device.
[import]uid: 32256 topic_id: 35574 reply_id: 142049[/import]

Unfortunately I’m getting the same error. Anything else I could have done wrong before this point? [import]uid: 93901 topic_id: 35574 reply_id: 142050[/import]

Bummer. This means that there is something wrong with your jarsigner. So, it’s definitely a JDK issue. This is an easy issue to work-around on Windows, but I’m not quite sure what can be done on Mac.

I still suspect that you have JDK 7 on your Mac and the command line is grabbing its jarsigner tool instead. In your Finder window, try going to the following directory…
//System/Library/Java/JavaVirtualMachines

You should see a “1.6.0.jdk” file in that directory.
If you also see a “1.7.0.jdk” file, then that will be a problem.
[import]uid: 32256 topic_id: 35574 reply_id: 142124[/import]

There is only a 1.6.0… [import]uid: 93901 topic_id: 35574 reply_id: 142147[/import]

I have access to another mac, which also has a windows 8 virtual machine. Can I use my corona license on either of these? [import]uid: 93901 topic_id: 35574 reply_id: 142153[/import]

Yes, you can install the Corona Simulator on up to 2 machines at a time. If you want to transfer your license from one machine to another, then you’ll want to “deauthorize” from the old machine first via the Corona Simulator’s “Preferences” window. [import]uid: 32256 topic_id: 35574 reply_id: 142174[/import]

No ideas?? [import]uid: 93901 topic_id: 35574 reply_id: 141909[/import]

It sounds like your APK is being digitally signed by the JDK 7 instead of the JDK 6, which signs with an encryption that Android does not support. Android only supports the JDK 6.

I suggest that you downgrade your from JDK 7 to 6 according to Apple instructions here…
http://support.apple.com/kb/HT5559?viewlocale=en_US&locale=en_US

Then re-build your APK with the Corona Simulator and re-install it to your Android device. [import]uid: 32256 topic_id: 35574 reply_id: 141932[/import]

Also, you can verify which version of Java you are running by typing in the following using the Mac’s Terminal window:
[lua]
java -version
[/lua]

If it returns version 1.7, then that’s the reason why it is signed wrong.
Android only supports Java version 1.6 (aka: Java 6). [import]uid: 32256 topic_id: 35574 reply_id: 141933[/import]

It looks like I have 1.6.0_37. That should then work, correct? I have my project folder subdivided into folders for images and scripts. Would this cause any problems? [import]uid: 93901 topic_id: 35574 reply_id: 141937[/import]

Would you mind trying to sign the APK yourself? This is to verify that jarsigner works on your machine, because it sounds like it should. Just type in the following at the Terminal window…
[lua]
jarsigner -keystore “./CoronaSDK/Resource Library/Android/debug.keystore” androiddebugkey
[/lua]

After running the above, the jarsigner tool will ask for a password. The password for Corona’s debug.keystore file is “android”.

Next, try to install your APK onto your Android device. If it installs correctly, then it sounds like the Corona Simulator is signing it wrong. If it does not install, then we’re having a problem with the jarsigner tool. [import]uid: 32256 topic_id: 35574 reply_id: 141988[/import]