Visual Studio 15.6 - "AndroidKeyStore" not working

ZenDroidZenDroid ✭✭✭USMember ✭✭✭

I use AndroidKeyStore in my project. But this is not working in Visual Studio 15.6. I run create archive and get error "apksigner.bat return code 2".
Xamarin Team - this is bug.

Posts

  • JonDouglasJonDouglas Xamurai USXamarin Team, University, Developer Group Leader Xamurai
    edited March 2018
  • ZenDroidZenDroid ✭✭✭ USMember ✭✭✭

    I use jdk8.

  • JonDouglasJonDouglas Xamurai USXamarin Team, University, Developer Group Leader Xamurai
    Double check on the command line. Even having jdk 1.9 installed can cause this.
  • JonDouglasJonDouglas Xamurai USXamarin Team, University, Developer Group Leader Xamurai
    Also ensure you don't have any special characters:

    https://forums.xamarin.com/discussion/123445/error-msb6006-apksigner-bat-since-upgrading-to-vs-15-6#latest

    We moved away from apksigner.bat in a future release to invoke the jar directly.
  • ZenDroidZenDroid ✭✭✭ USMember ✭✭✭
    edited March 2018

    I use only jdk8

    This is my brief history:
    -at first everything worked with 15.5
    -I updated to 15.6. I tried create archive and I get error "Password verification failed"
    - I created a new key(with password 1234567) but it does not work.
    - I had to return to the old version 15.5
    - Now signing working for 15.5. For 15.6(preview 7) signing not working. Even for a key with a simple password(1234567).
    - This is code from my csproj:

      <AndroidKeyStore>True</AndroidKeyStore>
      <AndroidSigningKeyStore>mypath</AndroidSigningKeyStore>
      <AndroidSigningStorePass>1234567</AndroidSigningStorePass>
      <AndroidSigningKeyAlias>alias</AndroidSigningKeyAlias>
      <AndroidSigningKeyPass>1234567</AndroidSigningKeyPass>
    
  • XamITXamIT ✭✭ USMember ✭✭

    There were no issues in VS 15.5.6.
    But upgrade to 15.6 (after 7 previews of this release) has caused disaster in Xamarin development.
    I uninstalled all of my Java 8.x and 9.x and reinstalled only the latest 8.162.
    And even then the experience with 15.6 is not changing.
    Debug process takes forever to build and attached to debugger... with no deployment to either VS Android Emulator or to my physical android device.

    It has been just discouraging when you can't focus on your core work to be developed..

    Let's hope that Microsoft will start looking at this tooling in a new way to help developer community..
    Otherwise, it will become another chapter like Windows 10 mobile OS

  • TomtomFooBarTomtomFooBar ✭✭ GTMember ✭✭
    edited March 2018

    Same issue here. No Java/JDK 1.9 on my system. Just updated to most recent VS, most recent Xamarin.Forms and to the 27.0.2 versions of the C# bindings, and now deployment fails with ApkSigner.bat exit code 2.

    The last time I tried updating Xamarin.Forms, I was forced to undo and stay with 2.3.4.270 because of Bugzilla 59896 . Now, months later I try again and here we are.

    Edit:
    All right, after copying the apksigner.bat command line from the build output to Cmd, I found that signing fails with "Keystore was tampered with, or password was incorrect".

    After changing the key and keystore password, removing all special characters (in my case #+!^ and = ) it's working now, even in VS.

  • BrendanZagaeskiBrendanZagaeski Xamurai USForum Administrator, Xamarin Team Xamurai
    edited March 2018
  • ZenDroidZenDroid ✭✭✭ USMember ✭✭✭

    Hi @BrendanZagaeski
    I updated Visual Studio to 15.6.2 and I changed my key(without special chars) - now it working.

  • ZenDroidZenDroid ✭✭✭ USMember ✭✭✭

    But I have new issue. When I installing my apk I get error: "apk failed to install could not parse error string"

  • yawnoyawno ✭✭ USMember ✭✭
    edited March 2018

    After updating I am receiving a similar error "The specified task executable "apksigner.BAT" could not be run. The system cannot find the file specified" this is with Visual Studio 15.6.3

    The apksigner.BAT does exist however it will only run for me as an administrator

  • ZenDroidZenDroid ✭✭✭ USMember ✭✭✭

    But does it work for you(as admin)?

Sign In or Register to comment.