Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot upload MAUI file to Playstore due to signing in released mode

Hello internet people,

I followed the Maui publication documentation

I got the aab file by following this process

The results I got are:

You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode. Find out more about signing. The Android App Bundle was not signed.

enter image description here

What can I do to get this right?

like image 514
Rikudou En Sof Avatar asked Sep 07 '25 08:09

Rikudou En Sof


1 Answers

Check if you did not forget the /p:AndroidKeyStore=True if you are building from command line!

My builds started being signed by the debug key even in release after a MSBuild update.

The command I used for building:

dotnet build -c Release 
             -f net7.0-android33.0
             /p:ApplicationVersion=1 
             /p:ApplicationDisplayVersion=test 
             /p:AndroidSigningKeyPass=mypass
             /p:AndroidSigningStorePass=mypass
             /p:AndroidSigningKeyStore=my.keystore
             /p:AndroidSigningKeyAlias=key

This worked great in MSBuild version 17.5.0-preview-23061-01+040e2a90e. The aab was signed with the specified key.

But with MSBuild version 17.5.1+f6fdcf537 my release builds suddenly started being signed with the debug key. After analysing the verbose logs I found out that AndroidKeyStore must be set to true for your custom key to be considered. I don't know whether this parameter was newly added or whether it was buggy and not considered before.

After I added the AndroidKeyStore parameter the signature was correct.

dotnet build -c Release 
             -f net7.0-android33.0
             /p:AndroidKeyStore=True     <--- add this
             /p:ApplicationVersion=1 
             /p:ApplicationDisplayVersion=test 
             /p:AndroidSigningKeyPass=mypass
             /p:AndroidSigningStorePass=mypass
             /p:AndroidSigningKeyStore=my.keystore
             /p:AndroidSigningKeyAlias=key
like image 190
Mirek Avatar answered Sep 10 '25 00:09

Mirek