Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Using Xamarin.Android 10.3 I'm trying to sign a Release package from Visual Studio 16.6.5. In order not to include the password as plaintext on the csproj file, I've added a file in the project folder called Pass.txt and exluded it in the git.ignore file

But when it comes to the signing process it fails with:

Failed to load signer "signer #1" java.io.IOException: Failed to read Key "myapp" password for signer #1 : end of file reached in C:\Users\myuser\source\repos\MyApp.Xamarin\Pass.txt

If I remove the file:Pass.txt and past the password it works fine.

According to this release we can use file: in Xamarin 10.1 an later.

<PropertyGroup>
  <AndroidSigningStorePass>file:C:\Users\Windows User\AndroidSigningPassword.txt</AndroidSigningStorePass>
  <AndroidSigningKeyPass>file:C:\Users\Windows User\AndroidSigningPassword.txt</AndroidSigningKeyPass>
</PropertyGroup>
                The exception says "end of file reached" so the file must have been opened at least, and the password is in the file, definetly.
– Fritjof Berggren
                Jul 24, 2020 at 15:37
                @FritjofBerggren How is your file structured? The error is saying it did not find the key "myapp", i.e. it is in key/value format (dictionary),
– SushiHangover
                Jul 24, 2020 at 15:48
                I just realized I had to put the password twice if the file is being used for the 2 entries
– Fritjof Berggren
                Jul 24, 2020 at 15:54
                Note that if the same file is specified for both settings, the file must contain two lines. The first line must be the keystore password, and the second line must be the alias password.
– Fritjof Berggren
                Jul 24, 2020 at 15:54

Missed "Note that if the same file is specified for both settings, the file must contain two lines. The first line must be the keystore password, and the second line must be the alias password. – Fritjof Berggren just now"

Adding the password twice on the file fixed it

Hi ,glad solved that ! Remember to mark it when you have time , it will be helpful for other people to know the solution later. :-) – Junior Jiang Jul 27, 2020 at 2:20

Sometimes the issue just fixes and you well never know how. This is what I did and it is fixed.

  • Goto Tools>> Android >> Android ADB Command Prompt
  • Type C:\Android\SDK>adb remove {your Package Name}
  • Clean Project
  • Build in Release Mode
  • after that clean and rebuild in Debug mode.

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.