1

I'm trying to create a public/private key pair using the keytool function so I can submit an Android app to Google Play. When I try to sign the app using the key I made, I get this error from jarsigner

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

Same thing when I try using RSA. When I look at the keys for the keystore, all I see if the
Entry type: PrivateKeyEntry

Not the public and private keys.

The command I used to create they key was

keytool -genkey -keystore nameofkeystore.keystore 
-alias coffitivity -keypass *passwordommitted* -storepass *thepasswordommitted*
Tommy Nicholas
  • 1,133
  • 5
  • 20
  • 31

1 Answers1

3

I'm not actually 100% sure what I did to fix it, but this is what I did and now it works

keytool -genkeypair -v -keystore my-release-key.keystore 
-alias coffdroid -keyalg RSA -keysize 2048 -validity 10000

Note: difference is I used "-genkeypair" instead of "genkey" even though they're supposed to be the same

Second: made a new unsigned .apk. This is likely what fixed it - so if you're hitting the wall, do that over.

Then Jarsigner

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 
-keystore my-release-key.keystore /Users/tommynicholas/Desktop/*apkname*.apk coffdroid
Tommy Nicholas
  • 1,133
  • 5
  • 20
  • 31