Build Error

Tried updating Java, running the latest daily build and neither make a difference. Have checked expiry date of keystore using KeyStore Explorer (useful tool) and it’s 2067, so no issue there.

Also tried other apps under the same keystore and they have the same problem.

debug key works fine.

Really confused now.

I get the message below when loading the keystore:

The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore KSF\_Android.keystore -destkeystore KSF\_Android.keystore -deststoretype pkcs12

So I run that command, am asked for the keystore password, which I enter, correctly, and then I’m asked for the key password for the first of my apps. I enter that, but get the following message:

keytool error: java.lang.Exception: The destination pkcs12 keystore has different storepass and keypass. Please retry with -destkeypass specified.

I have tried re-entering the overall keystore password, but that doesn’t work - I get the following error:

keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect

I have tried completely deleting the old keystore and creating a new one, which allows me to publish without the build error, but when I then go to install the new version of the APK on my device, I get the following error:

App not installed. An existing package by the same name with a conflicting signature is already installed.

Presumably, all my customers would receive the same error if I tried sending the new APK out.

So I’m stuck in a loop where the only thing I seem to be able to do to effectively publish out from Corona without getting this build error, is to delete the old keystore, which means the app can’t be run as an update.

Has anyone been through this process before and have any idea of how I can solve it. I’m complete at a loss as to how I go forward.

Thanks.

Your keystore file is a collection of individual keystores. That is you can have multiple keystores in a single keystore file. The individual keystores are known as aliases. Some people will have a keystore file with multiple keystores or they might have multiple keystore files that only have one keystore each.

Because of this when you create your keystore, you’re asked for two passwords. One for the overall file, and one for each alias stored in the keystore file. It’s possible that you have different passwords for each. You need to run the keystore conversion tool with all the necessary passwords.

Rob

Hi Rob,

Thanks for the reply.

That’s what I’m trying to do, but it won’t accept the password for the first individual keystore and I’m entering exactly the same one I’ve always used with no problems.

What I don’t get is why all this was working a few days ago and suddenly there are issues when nothing has changed at my end.

Are you aware of any way to reset or recover a keystore password so I can check if I might be making an error? I really don’t think I am - I’ve had these passwords for 5 years and they’ve always worked perfectly, but it’s the only thing I can think of. Otherwise I basically can’t ever update any of our Android apps again presumably, which would be a complete nightmare for us.

Thanks,

Ian

I’ve now managed to run the keystore conversion tool by adding the -destkeypass and the password on the end of the following:

keytool -importkeystore -srckeystore KSF\_Android.keystore -destkeystore KSF\_Android.keystore -deststoretype pkcs12

So that’s become:

keytool -importkeystore -srckeystore KSF\_Android.keystore -destkeystore KSF\_Android.keystore -deststoretype pkcs12 -destkeypass PASSWORD

I can then publish the app fine, but when I go to install it on an Android device that’s running the previous version of the app, I get the following error:

App not installed. An existing package by the same name with a conflicting signature is already installed.

So something seems to have corrupted the keystore during the conversion process and the package is now in some way different from the original.

One of those very frustrating days!

Thanks for the help so far.

Phew. Sorted it! I was entering the old password for the individual keystore for this app, which Corona was allowing me to do with no error, so I assumed it was the right password. Turns out the conversion tool set the new password to be the same as the overall Keystore password for all apps, so all my old individual passwords are now not used (which is easier).

So for anyone else having this issue, here is what I did…

Firstly, I was getting the following error:

ERROR: Build Failed: Error code: 256

When loading the Keystore in Corona on the Android build page, I was also seeing this:

The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore KSF\_Android.keystore -destkeystore KSF\_Android.keystore -deststoretype pkcs12

To migrate the keystore, as the above error suggested, I used the suggested command in the terminal, but this didn’t fully work, as I needed to add the -destkeypass to the end of that command, so I actually ran:

keytool -importkeystore -srckeystore KSF\_Android.keystore -destkeystore KSF\_Android.keystore -deststoretype pkcs12 -destkeypass PASSWORD

I had to enter all the old Keystore passwords for all the apps I had associated with that Keystore. Once that was done, I reloaded Corona, reloaded the Keystore on the Android build page, built for Android, and everything worked fine (no more build error).

However, when I then went to copy the app to the device to overwrite the old version, I couldn’t install it, getting the error:

App not installed. An existing package by the same name with a conflicting signature is already installed.

This was because, when I loaded the Keystore on the Android build page in Corona, I was asked first for the overall password (which I entered correctly) and then for the individual password for the particular app I was building. I entered the old, unique password for that app, as I assumed that had been migrated (as I had to enter it during the migration process). Turns out that wasn’t the case - the new password for each of my apps had been reset during the Keystore migration process to the same value as the overall Keystore password. So now I have one password for the Keystore and that same password is also the individual password for every single app.

I reloaded the Keystore in Corona, entering the same overall password twice and the build worked perfectly AND installed over the top of the old version of my app no problems. On running the app, all data remained from the old version and everything worked fine.

Hopefully anyone else having this issue will find the above works.

Thanks!

Glad you solved it!