Search code examples
androidapkkeystorejarsigner

Certificate chain not found for: <alias>. Can I recover it?


I'm developing a Cordova app for IOS and Android,

After a year, I made some changes and I want to update the app.

The problem begins when I need to sign the android's .apk,

I lost my .keystore, found it and included in the project dir ( different computer )

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore android-release-unsigned.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk appName

This returns:

jarsigner: Certificate chain not found for: appName. appName must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

what causes might be? it's not the right .keystore or the right alias? I'm missing some other file? (Can I restore from the original computer, somehow?)

I'm trying to prevent to have to submit a different app...


Solution

  • Seems you are using an invalid alias and jarsigner can not find it. List the keystore content to see what is the correct name:

    keytool -keystore android-release-unsigned.keystore -list -v 
    

    You can use also the GUI tool KeystoreExplorer to view the content.

    You can also check Certificate chain not found, how to fix and publish to Google Play Store?