I'm trying to upload the bundle file for my .NET MAUI app to Google Play but I'm getting the following error:
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:
It then shows the fingerprint it's expecting. I see the SHA1 and SHA256 fingerprints Google PLay is expecting under App Integrity > App Signing tab and these fingerprints are different than the ones created when I followed the documentation for publishing .NET MAUI to Google Play at https://docs.microsoft.com/en-us/dotnet/maui/android/deployment/overview
Google Play allows me to download certs i.e. upload_cert
and deployment_cert
. How do I use the fingerprints in these certs when creating my .NET MAUI app's Android package?
CodePudding user response:
This is happening because I had already uploaded another version of my app to Google Play and now the signing key is not matching.
Here's how I was able to resolve the issue:
- Log into Google Play Console for developers and select the app you're trying to upload
- My app is currently in "Closed Testing" so I selected "Closed Testing" from the main menu on the left which is under "Release" section and "Testing" subsection
- I already have a track so I selected "Manage Track" button
- Once in the track, I clicked "Edit Release" button
- Once in "Edit Release" screen, right under "App Integrity", there's a link that reads "Change app signing key". Click that link
- This opens a warning modal, click the "Change app signing key" button to proceed
- This opens up another popup window with 4 options. Select the third one that reads "Export and upload a key from Java keystore"
- This entails 3 steps of its own. First, you click the first link to download a utility app named "PEPK Tool". I downloaded this app right where my keystore file is. It doesn't have to be in the same folder but it makes pointing to it easier.
- THe popup on Google Play also gives you a command to run with long paramter. Next step is to run this but there are two important points here
- First important point is to use the correct file name for your keystore. The generic command suggests
foo.kestore
. Change it to whatever your keystore file's name currently is. - The next important point was tricky for me because I had to remmeber the
alias
I used when I was generating my keystore file. If you remember it, just use it in the command you're going to run. The generic command suggestsfoo
. Just use the correct one. If you don't remember thealias
you used, then runkeytool -list -v -keystore "foo.keystore" -storepass myPassword
which will give you all the entries in your keystore which will include thealias
. Again, in this command, don't forget to use the correct filename for your keystore along with the password you used. - If you do the previous step correctly, the command you copied from Google Play will generate a file named
output.zip
. You then upload it to Google Play on the same screen.
If you do all this correctly, you should now be good to go! Good luck!