I'm trying to sign my .NET MAUI app for Google Play submission but keep getting the following error:
Here's a quick background:
The keystore I used to submit the original version of my app got compromised so even though I still have the original keystore, I had to contact Google to reset my upload key.
I generated a new upload key in a new keystore i.e. keystore.jks
, exported the upload_certificate.pem
file and submitted it to Google and they notified me that they reset my upload key on their end.
I'm now trying to use the new keystore.jks
to sign my app. In my project file, I have the following:
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0-android' and '$(Configuration)' == 'Release'">
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>..\keystore.jks</AndroidSigningKeyStore>
<AndroidSigningKeyAlias>mynewalias</AndroidSigningKeyAlias>
</PropertyGroup>
I issue the following command to create a signed package:
dotnet publish -f:net7.0-android -c:Release /p:AndroidSigningKeyPass=MyPassword /p:AndroidSigningStorePass=MyPassword
I issue this command in the root of my project and the keystore.jks
file is one level up i.e. where my .sln
file is so the path is correct.
Any ideas/suggestions on what maybe causing this issue and how to fix it?
The problem was the alias. I made sure that I made a note of the alias I used but admittedly I wasn't really interested in fully understanding the keytool
commands I was issuing. I copied and pasted most of them from the Google email and used them to generate the new keystore and the upload certificate.
When I ran keytool -list -v -keystore myapp.keystore
command, I noticed that the alias in the keystore was different than the one I had in the csproj
file.
Once I changed it to the correct alias from the keystore, everything worked fine.