Bug 61065 - debug.keystore is missing in mac and windows installer jarsigner exited with value: 1
Summary: debug.keystore is missing in mac and windows installer jarsigner exited with ...
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 8.1 (15.5)
Hardware: PC Mac OS
: High normal
Target Milestone: 15.6
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-12-11 06:06 UTC by gcnew
Modified: 2018-01-08 15:10 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Diagnostic output (4.87 MB, text/rtf)
2017-12-14 05:51 UTC, gcnew
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description gcnew 2017-12-11 06:06:41 UTC
I just installed visual studio mac and cannot deploy my app.
Deploy fails on mac because xamarin installer does not ship the following file:
Users/vk/.local/share/Xamarin/Mono for Android/debug.keystore
I experienced this problem on Windows too. I found this file on my colleague PC and put it there.
On windows it is missing at the following path:
C:\Users\<username>\AppData\Local\Xamarin\Mono for Android\debug.keystore
It happens only on fresh install. If you just update this file remains from the old installs.

jarsigner
    [MESSAGE] jarsigner error: java.lang.RuntimeException: keystore load: /Users/vk/.local/share/Xamarin/Mono for Android/debug.keystore (No such file or directory)
    jarsigner error: java.lang.RuntimeException: keystore load: /Users/vk/.local/share/Xamarin/Mono for Android/debug.keystore (No such file or directory)
    [MESSAGE] /usr/bin/jarsigner exited with value: 1
    /usr/bin/jarsigner exited with value: 1
    [END] jarsigner
    [MESSAGE] Removing temporary directory: /var/folders/lq/4z58m7bd3g9d8qr2v6r41m9r0000gn/T/z3j5qsn7.t96
    Removing temporary directory: /var/folders/lq/4z58m7bd3g9d8qr2v6r41m9r0000gn/T/z3j5qsn7.t96
    [END] Creating /Users/vk/Library/Caches/Xamarin.Android/Mono.Android.Platform.ApiLevel_26.apk
     Deployment failed
    System.InvalidOperationException: '/usr/bin/jarsigner' exited with code '1': 
      at Xamarin.AndroidTools.PlatformPackage.Exec (System.String step, System.Diagnostics.ProcessStartInfo psi, Xamarin.AndroidTools.IProgressNotifier progressReporter, System.Threading.CancellationToken token) [0x0007d] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/PlatformPackage.cs:228 
      at Xamarin.AndroidTools.PlatformPackage.Jarsigner (System.String unsigned, System.String packageDir, Xamarin.AndroidTools.IProgressNotifier progressReporter, System.Threading.CancellationToken token) [0x00057] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/PlatformPackage.cs:250 
      at Xamarin.AndroidTools.PlatformPackage.GetPlatformPackagePath (System.Int32 apiLevel, System.String aaptPath, Xamarin.AndroidTools.IProgressNotifier progressReporter, System.Threading.CancellationToken token) [0x00155] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/PlatformPackage.cs:123 
      at Xamarin.AndroidTools.AndroidDeploySession+<InstallSharedPlatformAsync>d__105.MoveNext () [0x00080] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:327 
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152 
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
      at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
      at Xamarin.AndroidTools.AndroidDeploySession+<EnsureCorrectSharedRuntimes>d__102.MoveNext () [0x0017a] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:249 
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152 
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
      at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113 
      at Xamarin.AndroidTools.AndroidDeploySession+<RunAsync>d__101.MoveNext () [0x001fd] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:188 
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152 
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
      at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113 
      at Xamarin.AndroidTools.AndroidDeploySession+<RunLoggedAsync>d__99.MoveNext () [0x00026] in /Users/builder/data/lanes/5749/9cfa7836/source/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:113 
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(514,2): error : '/usr/bin/jarsigner' exited with code '1': 

My IDE info:
Visual Studio Community 2017 for Mac
Version 7.3 (build 799)
Installation UUID: 5a6a77e3-dacb-4454-ba56-0244e74141c9
Runtime:
	Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010007

NuGet
Version: 4.3.1.4445

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Version: 2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 9.2 (13772)
Build 9C40b

Xamarin.iOS
Version: 11.6.1.2 (Visual Studio Community)
Hash: 6857dfcc
Branch: xcode9.2
Build date: 2017-12-04 21:20:41-0500

Xamarin.Android
Version: 8.1.0.24 (Visual Studio Community)
Android SDK: /Users/vk/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.1 (API level 16)
		7.1 (API level 25)
		8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.0
SDK Build Tools Version: 27.0.2

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Inspector
Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

Xamarin.Mac
Version: 4.0.0.214 (Visual Studio Community)

Build Information
Release ID: 703000799
Git revision: df590420ea5bc681994baefff2eabdaad889fba9
Build date: 2017-12-05 09:23:45-05
Xamarin addins: 51068d6eaf3b6fb4fbc72b33cb869b0ebff04ec5
Build lane: monodevelop-lion-d15-5

Operating System
Mac OS X 10.13.1
Darwin 17.2.0 Darwin Kernel Version 17.2.0
    Fri Sep 29 18:27:05 PDT 2017
    root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

Enabled user installed addins
Internet of Things (IoT) development (Preview) 7.1
Comment 1 dean.ellis 2017-12-11 10:27:58 UTC
This is weird. The Key should be created by the _ResolveAndroidSigningKey target. It should be done on the first build.

Can you provide diagnostic output?

https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/
Comment 2 gcnew 2017-12-14 05:51:22 UTC
Created attachment 26000 [details]
Diagnostic output

As per request
Comment 3 dean.ellis 2018-01-02 11:41:49 UTC
Looks like there are values for things like _ApkKeyStore in this configuration (the Debug one). As a result the debug.keystore never gets created by the _ResolveAndroidSigningKey target. This then causes the signing of the Platform API to fail. 

We should probably always create the debug.keystore even if things like _ApkKeyStore  are already set and it does not exists. 

In the mean time take a look and see if you set `AndroidKeyStore` for the debug configuration and if you do try to set it only for Release.
Comment 4 dean.ellis 2018-01-02 12:55:00 UTC
I have just confirmed with the code that if `AndroidKeyStore` is set to True this will prevent the debug keystore from being created. That said, you shouldn't be setting `AndroidKeyStore` to true for debug configurations or configurations which use the shared runtime.
Comment 5 dean.ellis 2018-01-02 15:56:15 UTC
We are going to rework how this works a bit

https://github.com/xamarin/xamarin-android/pull/1148
Comment 6 dean.ellis 2018-01-08 15:10:24 UTC
Fixed in xamarin-android/master/5b2e027