[Solved] Android key does not match what Google Play has expects

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

[Solved] Android key does not match what Google Play has expects

#1 Post by Imperf3kt »

I know I shouldn't be using a pre-release for the final build, but my app needs regular updating and I cannot wait any longer, I am already several months behind on updates, so I decided to push out a build using the 8.1 pre-release which appears to be very stable in all my testing.

The issue however, occurs when I try to upload an update to Google Play, informing me the key used to sign the project does not match the one expected.

Luckily, I have backups and simply replaced the incorrect files, but it still says the keystore files are incorrect.

The SHA1 does not match what Google expects.
Does anybody know what could be causing this? I really need to put this update out as soon as I can, as I am trying to keep up with a 3rd party and being up to date is rather important.
Last edited by Imperf3kt on Sun May 28, 2023 4:18 pm, edited 2 times in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

sandpie
Newbie
Posts: 18
Joined: Tue Apr 25, 2023 1:43 pm
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#2 Post by sandpie »

in the changelog of 8.1.0 says:
When the new "Generate Keys" button is pressed, if old keystore files exist, Ren'Py will offer to copy the old files into the project.
so it sholud have done that, but I guess you can do it by yourself as a plan B: copy your old project keystore inside your project base directory (make it build the keystore files first, so that any possible reference is built and flag is set), then overwrite the keystore files.

Maybe (AT YOUR OWN RISK, always backup first!) see this post viewtopic.php?p=560251#p560251
I am not sure of what happens there, but you could try to edit android.json and set update_keystores to false (with your old keystore in the new project)
I presume it could use the existing keystores without trying to update them.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#3 Post by Imperf3kt »

I'll try that they, thanks sandpie.

I made backups but even using those results in different keys as renpy wants to force me to regenerate the keys whenever I paste them in the folder
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#4 Post by Imperf3kt »

I've had no luck with this.
Even rolling back to the release version of Ren'Py, and replacing the keystore files with my backups from 2021, Google still complains that the App Bundle is signed with the wrong key.

I don't understand how, as I've repeatedly ensured both Android.keystore and bundle.keystore are the correct files.
Am I missing something else?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Ajeb
Newbie
Posts: 15
Joined: Thu Feb 07, 2019 7:22 am
Projects: FLY : Forever Loving You (2)
Deviantart: AjebFLY
itch: ajeb
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#5 Post by Ajeb »

Imperf3kt wrote: Wed May 03, 2023 3:45 am I've had no luck with this.
Even rolling back to the release version of Ren'Py, and replacing the keystore files with my backups from 2021, Google still complains that the App Bundle is signed with the wrong key.

I don't understand how, as I've repeatedly ensured both Android.keystore and bundle.keystore are the correct files.
Am I missing something else?
Same issue here. The android & bundle keystore files in my folders are the same ones I've used since launch (& since bundle files were introduced). It insists I used the wrong key, even though the right keystores are in my folders, and no new keys have been generated. I've even tried copy-pasting the files in different folders, but nothing. I tried with the same Ren'Py version I used for my last updated, and then the latest Python 2 version, but it doesn't work either way.
Anyone knows what we can do?
Image
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#6 Post by PyTom »

Are you on the current prerelease? There had been an issue where it used the apk key as the bundle key, but that's since been fixed.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Ajeb
Newbie
Posts: 15
Joined: Thu Feb 07, 2019 7:22 am
Projects: FLY : Forever Loving You (2)
Deviantart: AjebFLY
itch: ajeb
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#7 Post by Ajeb »

PyTom wrote: Fri May 12, 2023 12:15 am Are you on the current prerelease? There had been an issue where it used the apk key as the bundle key, but that's since been fixed.
Thank you for your extremely quick answer!!!
I was on the latest release, and updated to the latest prerelease, but the issue still persists. I've tried as much as I could that I've seen people try for similar issues, but still nothing, unfortunately.

The message I get is as follows:

You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The upload certificate has fingerprint:
SHA1: E2:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
and the certificate used to sign the APK you uploaded has fingerprint:
SHA1: E0:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


And this is with the correct android & bundle keystores being in my rapt, sdk and main project folder in case it tries to look for it somewhere it is not


EDIT: I even finally updated to Ren'Py 8 and tried both the release and the pre-release, but I still get the same message, unfortunately. Completely uninstalling and reinstalling Ren'Py, and adding the keystore files back in the right folders does not work either. Don't know if it'll help, but trying to upload a universal apk gives me the same error, which means it's not necessarily a problem with the bundle keystore, but maybe the android keystore ? The game works perfectly when installed and launched on my android phone from Ren'Py itself, but I had to delete the last version of my game from my phone in order to be able to download it.
EDIT 2: I also completely uninstalled Ren'Py two or three more times, installed it on my desktop instead of in my programme files folder, tried with different release and prerelease versions, generated new android keys and replaced the newly generated keys with my backup of the old android and bundle keystores i had, tried to just put the keys there without generating them, etc, but I still get the exact same error message when uploading it on the Play Console every time

Checked "local.properties" and "bundle.properties" in "rapt/project" before each attempt, and the keystore path was correct every time
Editing android.json to set update_keystores to false does not change a thing
The "certificate used to sign the APK" which they say is not the right one has the same code every time I try to release the new update
Trying all of this, it really feels like a keystore problem but I've truly been using the same ones that I've used since release and backed up, and even kept replacing them with different back-ups of the same files, but still get the exact same error message
Image
Image

User avatar
emilkun
Newbie
Posts: 16
Joined: Tue Apr 28, 2015 6:11 am
Location: England
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#8 Post by emilkun »

Imperf3kt wrote: Mon May 01, 2023 6:43 am The SHA1 does not match what Google expects.
Any workaround for this? Updated to the latest release and I still get the same issue, and my keystore files are my original ones from 2015 for the android one and 2021 for the bundle one after obb became obsolete. They're the only keystore files I have so it can't be a mix-up, and none of what was mentioned in this thread worked as well... thanks in advance if anyone can help

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#9 Post by Imperf3kt »

emilkun wrote: Tue May 16, 2023 9:51 am
Imperf3kt wrote: Mon May 01, 2023 6:43 am The SHA1 does not match what Google expects.
Any workaround for this?
Haven't worked out how to fix this yet.

I'll post here if I ever find a solution or what's causing it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Ajeb
Newbie
Posts: 15
Joined: Thu Feb 07, 2019 7:22 am
Projects: FLY : Forever Loving You (2)
Deviantart: AjebFLY
itch: ajeb
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#10 Post by Ajeb »

Still nothing on my end either. The store keeps saying I've signed my app with the wrong key but I haven't. I've tried everything I could think of and still nothing
I'm starting to lose hope a little and even considering reuploading the game entirely to the play store -- losing my 19k downloads stats and 4.8 rating -- but even with my limited knowledge I can feel like it's a lost cause

To add to my previous message, here is what I tried on top of all of that:

- Completely uninstalling Ren'Py and re-downloading everything after every new attempt, installing the software at a different spot on my computer every 5 or so installs.
- Disabling my antivirus in case it tried to meddle with something
- Manually downloading and extracting rapt instead of letting Ren'Py do it on its own once every other reinstall
- Tried installing different versions of Ren'Py between the latest release, prerelease, nightly build, going back and forth between Ren'Py 7, and Ren'Py 8, but making sure most of my attempts were made on stable releases
- Deleting the last generated .aab file and the tmp/[ProjectName] folder every time I ran out of ideas as to what might cause the issue
- Made sure the rapt>project>local & bundle followed the right path for the keystore files (they do)
- Simply made sure to restart my computer every now and then just because I'm desperate to find a solution lmao
- Replacing every keystore file present in every folder on my computer (The Question, etc) with my backups in case Ren'Py tried to look for the android and bundle keystore files somewhere else, and making sure the right keystore files were present in all of the right folders (even where they don't need to be for safety)

And these are the same keystore files I've used since 2021 for the android one, my latest successful release being in June 2022 (the bundle file being from March 2022, my first release using a bundle file from then, and all of my backups being from then so I'm 100% positive this is the right one)

I'm starting to run out of ideas and I've been spending most of my free time for a week trying to find an issue but the keystore files can't be at fault here -- nothing changed. Originally, the Ren'Py folder used was the same one as the one for my successful June 2022 release -- had to update it to the latest stable release for compatibility issues or API versions or whatever -- and that's when the following message started appearing
"You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The upload certificate has fingerprint:
SHA1: E2:XXXXXXXXXXXXXX
and the certificate used to sign the APK you uploaded has fingerprint:
SHA1: E0:XXXXXXXXXXXXXX"

Unlike OP (I think), mine is the same wrong upload certificate SHA1 code every time, but HOW, since I'm using the right keystore files, and there is no doubt they're the right ones, as I've backed them up on my OneDrive, two different flash disks, an external hard drive, and a random folder on my laptop as soon as they got generated, they have been used in successful releases in the past, and the keystore files ALL match?

Do you guys think contacting Google itself might help in that case? Since these are the right keystore files, this cannot actually be a signing problem, right?
Image
Image

User avatar
emilkun
Newbie
Posts: 16
Joined: Tue Apr 28, 2015 6:11 am
Location: England
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#11 Post by emilkun »

I'm giving up trying to find workarounds as well because I'm still using the same keys and nothing seems to fix the issue. Store console support might help indeed. I'll get in touch and keep y'all updated if they're of any help.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#12 Post by PyTom »

Can you try the Nightly Fix builds from https://nightly.renpy.org/ ? Beyond that, it's likely that different keys are being used.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#13 Post by Imperf3kt »

PyTom wrote: Sun May 21, 2023 4:21 pm Can you try the Nightly Fix builds from https://nightly.renpy.org/ ? Beyond that, it's likely that different keys are being used.
Will give this a try asap (2 hours is the earliest I can try) however I'm not sure if it will help, even downgrading renpy to the same version I initially built the game with, fails to upload to the Play store, complaining of a key mismatch.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#14 Post by PyTom »

Sure.

Also, if someone is willing (and this is a big ask), I'd like to work with someone willing to send me their keystores, and the hashes that google is giving them. (That aren't matching.) I'll need the keystore files (and the full paths to those files), the local.properties and bundle.properties files, and the errors that google play is giving. Please PM me this information (And if sharing files via google drive, my user is renpytom@gmail.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Android key changing every time I build a new app bundle for Google Play

#15 Post by Imperf3kt »

The Nightly build did not work, still had the same error.

I'm willing to share my keystore files, I'm aware of the risks involved.

I'll send along the files after work today (local timezone is GMT+10)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Bing [Bot]