Tying to deploy a new version of a current app on Play Store.

I have the old .keystore file used in order to sign the previous app, and when I try to add the metadata on the key.properties file under the android folder I got the following exception

key.properties file content:

storePassword=xxx
keyPassword=xxx
keyAlias=key
storeFile=C:/Users/Nike/**key.keystore**

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageReleaseBundle'.
> java.util.concurrent.ExecutionException: java.lang.RuntimeException: jarsigner.exefailed with exit code 1 :
  jarsigner: Certificate chain not found for: key.  key must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

On the previous for other apps distribute I've generate a key.jks file and the distribution was done successfully.

But this app has already a first version on Play Store developed using Xamarin and now the new version developed using Flutter needs the previous certificate in order to be signed.

1

There are 1 best solutions below

0
nike On

The issues occurred because the keyAlias=key was not correct.

> C:\Program Files\Java\jdk1.8.0_181\bin>keytool -v -list -keystore C:\Users\Nike\keyname.keystore

Under the java keytool location. Was able to found the Alias name for the keyname.keystore.

storePassword=xxx
keyPassword=xxx
keyAlias=newAliasName
storeFile=C:/Users/Nike/**key.keystore**

Flutter clean and flutter build appbundle create the app bundles