4

I have a game on Google Play that I have to update. The game was made long time ago in Unity 2017, at the time I don not remember having any app signing process, or if I had I dont remember where that file is.

When uploading the apk to Google play I got the error:

Upload failed
You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The upload certificate has fingerprint:
[ SHA1: F9:F0... ]
and the certificate used to sign the APK you uploaded have fingerprint:
[ SHA1: 3D:67... ]

I searched this problem and followed the following threads and accepted solutions: https://answers.unity.com/questions/1372982/how-i-can-sign-my-apk-with-an-google-plays-upload.html and Signing an APK with an upload key provided by Google Play

Here is what I did:

  • I created a new keystore file in unity and a new key and gave it the alias user.
  • I downloaded the upload certificate from my Play console.
  • I then added the upload certificate to my keystore file that I generated in first step using : keytool.exe -importcert -file upload_cert.der -keystore <keystorefile>
  • This worked fine and when I check the keystore file with the command: keytool.exe -list -keystore "C:\user1.keystore":

.

Keystore type: jks
Keystore provider: SUN

Your keystore contains 2 entries

user, 06-May-2019, PrivateKeyEntry,
Certificate fingerprint (SHA1): FD:A6:5A:...
mykey, 06-May-2019, trustedCertEntry,
Certificate fingerprint (SHA1): F9:F0:89:...

As can be seen that the command added the required certificate key to my keystore but it created a different entry for it mykey and did not overwrite user.

Now when I want to build my apk in unity and choose the keystore and key from publishing settings, only the user alias shows up there, and the apk is signed with the user SHA1 and not the required mykey SHA1.

I just cant seem to get this silly update out and Ive wasted a full day trying to fix this. Any help would be appreciated.

Thanks

StuckInPhDNoMore
  • 2,507
  • 4
  • 41
  • 73
  • 1
    I am afraid that if you lost your signing key you won't be able to update your app. I learned it the hard way. – Dave May 06 '19 at 19:12
  • 1
    But I dont ever remember downloading the keystore file. There was this option that let Google manage that and I dont have to have a physical copy. Thats what I did. – StuckInPhDNoMore May 06 '19 at 21:01
  • Maybe you have generated the keystore with Unity? If you used app signing by Google Play to manage the signing key for you then please check my answer. – Dave May 06 '19 at 22:13

1 Answers1

4

In case you used app signing by Google Play and you lost or compromised the upload key you need to follow official Google instructions:

If you’ve lost your private upload key, or it’s been compromised, you can create a new one, and then ask your account owner to contact support to reset the key. When contacting support, make sure your account owner attaches the upload_certificate.pem file.

After our support team registers the new upload key, you receive an email, and then you can update your keystores and register your key with API providers.

Important: Resetting your upload key doesn’t affect the app signing key that Google Play uses to re-sign APKs before delivering them to users.

Dave
  • 2,684
  • 2
  • 21
  • 38