Skip to main content

Issues with sign in key...

When attempting to upload a APK package, I'm getting the following response

Your Android App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key and try again. Your app bundle is expected to be signed with the certificate with fingerprint:
SHA1: 87:EF:1D:19:B4:A7:72:79:1E:49:26:5B:F2:28:DE:11:DA:3D:26:B6
but the certificate used to sign the app bundle that you uploaded has fingerprint:
SHA1: F8:92:39:CB:5C:CE:D8:11:27:B7:19:1A:29:29:62:1A:36:0B:09:1D

 

Clean Gradle

Before building the app helps clear previously cached builds.  From the Android directory, run

./gradlew clean

Response - similar to

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Configure project :app
WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.

> Configure project :capacitor-cordova-android-plugins
WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.

BUILD SUCCESSFUL in 5s
13 actionable tasks: 12 executed, 1 up-to-date

 

Find the fingerprint of a pem certificate

Compare the 'Upload key certificate' locally against what's on Google Play Store

openssl x509 -noout -fingerprint -sha1 -inform pem -in {certificate-name.pem}

Response will be similar to 

sha1 Fingerprint=87:EF:1D:19:B4:A7:72:79:1E:49:26:5B:F2:28:DE:11:DA:3D:26:B6

 

KeyStore check content of file

If you want to list the contents of your keystore file (and alias name), the run

keytool -v -list -keystore /path/to/keystore

However, if you are looking for a specific alias, you can also specify it in the command:

keytool -list -keystore /path/to/keystore -alias {your-alias}

When running either of these commands, your will be prompted for the keystore's password

Enter keystore password:

Response post entering the correct password

Keystore type: {type}
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: upload
Creation date: 8 Aug. 2022
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: {owner details}
Issuer: {owner details}
Serial number: {serial number}
Valid from: Mon Aug 08 16:26:42 AEST 2022 until: Fri Aug 02 16:26:42 AEST 2047
Certificate fingerprints:
	 SHA1: {SHA1-fingerprint-response}
	 SHA256: {SHA256-fingerprint-response}
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions:

#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
   {identifer}
]
]



*******************************************
*******************************************

 

Related articles

Andrew Fletcher31 Oct 2023
Android icon not changing
If the Android app icon is not changing from the default icon (in my situation this was the Capacitor icon), here are some steps to troubleshoot and resolve the issue: Check the Icon FilesEnsure that you have provided the correct icon files in the appropriate directory. In a Capacitor project,...