Joshua Rogers
Joshua Rogers

Reputation: 3558

Failed to load signer on Xamarin.Android

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

enter image description here

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>

Upvotes: 2

Views: 3553

Answers (4)

HansHeinz
HansHeinz

Reputation: 29

Feb 2024: I had the same problem and had to change

OLD:

<propertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
    <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
    <AndroidKeyStore>True</AndroidKeyStore>
    <AndroidSigningStorePass>xxxxx</AndroidSigningStorePass>
    <ApplicationId>com.aaaaa.bbbbb</ApplicationId>
</PropertyGroup>

TO:

<propertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
    <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
    <AndroidKeyStore>True</AndroidKeyStore>
    <AndroidSigningKeyPass>xxxxx</AndroidSigningKeyPass>
    <AndroidSigningStorePass>xxxxx</AndroidSigningStorePass>
    <ApplicationId>com.aaaaa.bbbbb</ApplicationId>
</PropertyGroup>

The line with AndroidSigningKeyPass (!) was missing.

Upvotes: -2

Starlin Gonz&#225;lez
Starlin Gonz&#225;lez

Reputation: 327

For me this issue was that I have the folder in One Drive and I have set the option for saving space, so I just have the link in my machine,as soon as I download the file, it works

Upvotes: 1

Sayed M. Idrees
Sayed M. Idrees

Reputation: 1408

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

  1. Goto Tools>> Android >> Android ADB Command Prompt
  2. Type C:\Android\SDK>adb remove {your Package Name}
  3. Clean Project
  4. Build in Release Mode

after that clean and rebuild in Debug mode.

Upvotes: 2

Joshua Rogers
Joshua Rogers

Reputation: 3558

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

Upvotes: 4

Related Questions