0

I'm new to keytool and following the steps on this page .NET MAUI Android target publishing/archiving. I successfully created a keystore but upon attempting to use it in publishing the app via dotnet publish -f:<target_framework> -c:Release at the very end I got the same error in this article: jarsigner.exe exited with code 1 error in .NET MAUI app.

Trying to resolve that, I found this article: What is the significance of "key password" in keystore using keytool. So, assuming I got something wrong, I started over -- deleted the keystore and created a new one.

But the second time, it did not prompt for the "key password" at the end; i.e., it did not display this prompt:

Enter key password for <my-app> //Why this password is required???
        (RETURN if same as keystore password): 

It did all the rest (see command output at bottom), but that second prompt never appears; only the first time I ran keytool and created the very first keystore. So, I'm not sure what's next. Do I just ignore that it doesn't prompt for that and not include that in my key info? So, in the below, I would exclude the <AndroidSigningKeyPass/> entry?

<PropertyGroup Condition="$(TargetFramework.Contains('-android')) and '$(Configuration)' == 'Release'">
    <AndroidKeyStore>True</AndroidKeyStore>
        <AndroidSigningKeyStore>key.keystore</AndroidSigningKeyStore>
    <AndroidSigningStorePass>keystore password</AndroidSigningStorePass>
    <AndroidSigningKeyAlias>alias</AndroidSigningKeyAlias>
    <AndroidSigningKeyPass>key password</AndroidSigningKeyPass>
</PropertyGroup>

keytool command output

AdvApp
  • 1,094
  • 1
  • 14
  • 27
  • I just found this article https://stackoverflow.com/questions/2889238/keystore-change-passwords about how to charge either password. But, is it weird that it no longer prompts the second time? – AdvApp Mar 30 '23 at 01:43

1 Answers1

1

I figured it out. There are two keytool.exe installed with VS 2022: One in C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin the other in C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin.

I managed to use the one from the Eclipse folder the first time -- which prompts for both keystore password AND key password and produces a proprietary (non-PKCS12) format keystore. The second and subsequent times, I managed to use the one in the Microsoft folder -- which prompts only for the keystore password and produces a PKCS12-compliant keystore.

AdvApp
  • 1,094
  • 1
  • 14
  • 27