title: calabash-android giving "No keystores found." when run under Jenkins
body: <p>I have a simple test android project that I can test fine using ".\gradlew calabashDebug" in a DOS shell logged in as myself. However, when I run the project under Jenkins on a Continuous Integration server it fails with a "No keystores found." error 
  (see stack trace below).</p>
  
  <pre><code>07:54:04.462 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
  07:54:04.464 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'cmd'.
  07:54:04.507 [INFO] [org.gradle.process.internal.ProcessParentingInitializer] An attempt to initialize for well behaving parent process finished.
  07:54:04.513 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
  07:54:04.513 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
  07:54:04.514 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command 'cmd''
  07:54:05.111 [QUIET] [system.out] No test server found for this combination of app and calabash version. Recreating test server.
  07:54:05.111 [QUIET] [system.out] No keystores found.
  07:54:05.112 [QUIET] [system.out] Please create one or run calabash-android setup to configure calabash-android to use an existing keystore.
  07:54:05.117 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
  07:54:05.118 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'cmd'' finished with exit value 1 (state: FAILED)
  07:54:05.119 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':calabashDebug'
  07:54:05.119 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :calabashDebug FAILED
  07:54:05.120 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :calabashDebug (Thread[main,5,main]) completed. Took 0.666 secs.
  07:54:05.120 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 1.014 secs, idle: 0.016 secs
  07:54:05.125 [ERROR] [org.gradle.BuildExceptionReporter] 
  07:54:05.127 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
  07:54:05.127 [ERROR] [org.gradle.BuildExceptionReporter] 
  07:54:05.127 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
  07:54:05.129 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':calabashDebug'.
  07:54:05.129 [ERROR] [org.gradle.BuildExceptionReporter] &gt; Process 'command 'cmd'' finished with non-zero exit value 1
  07:54:05.130 [ERROR] [org.gradle.BuildExceptionReporter] 
  07:54:05.131 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
  07:54:05.132 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':calabashDebug'.
  07:54:05.132 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
  07:54:05.132 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
  07:54:05.133 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
  07:54:05.133 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
  07:54:05.133 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
  07:54:05.134 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
  07:54:05.134 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
  07:54:05.134 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
  07:54:05.134 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
  07:54:05.135 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
  07:54:05.135 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
  07:54:05.135 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
  07:54:05.136 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
  07:54:05.136 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
  07:54:05.137 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Factories$1.create(Factories.java:22)
  07:54:05.137 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
  07:54:05.137 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266)
  07:54:05.137 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135)
  07:54:05.138 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:95)
  07:54:05.138 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
  07:54:05.138 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
  07:54:05.138 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
  07:54:05.139 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
  07:54:05.139 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
  07:54:05.139 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
  07:54:05.140 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
  07:54:05.140 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
  07:54:05.140 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
  07:54:05.140 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
  07:54:05.141 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
  07:54:05.141 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
  07:54:05.141 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
  07:54:05.142 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
  07:54:05.142 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
  07:54:05.142 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
  07:54:05.143 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
  07:54:05.143 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
  07:54:05.143 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
  07:54:05.144 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
  07:54:05.144 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
  07:54:05.144 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
  07:54:05.144 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
  07:54:05.145 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
  07:54:05.145 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
  07:54:05.145 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.doAction(Main.java:46)
  07:54:05.145 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
  07:54:05.146 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.main(Main.java:37)
  07:54:05.146 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
  07:54:05.146 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
  07:54:05.147 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  07:54:05.147 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
  07:54:05.147 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
  07:54:05.148 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
  07:54:05.148 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.process.internal.ExecException: Process 'command 'cmd'' finished with non-zero exit value 1
  07:54:05.148 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:361)
  07:54:05.149 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:31)
  07:54:05.149 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.tasks.Exec.exec(Exec.java:63)
  07:54:05.149 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
  07:54:05.149 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
  07:54:05.150 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
  07:54:05.150 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
  07:54:05.150 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
  07:54:05.150 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
  07:54:05.151 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
  07:54:05.151 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
  07:54:05.151 [ERROR] [org.gradle.BuildExceptionReporter]    ... 52 more
  </code></pre>
  
  <p>Problem is there is no indication as to where it expects the keystore to be by default. I have tried putting the keystore in a .android\debug.keystore under JENKINS_HOME directory. I have also tried to put a calabash_settings file (and also a .calabash_settings file) with the following:</p>
  
  <pre><code>{"keystore_location":"C:\\Program Files (x86)\\Jenkins\\.android\\debug.keystore","keystore_password":"android","keystore_alias":"androiddebugkey"}
  </code></pre>
  
  <p>I have found one issue to be that the gradle-calabash-android-plugin that I use in my build.gradle does not specify "-v" or "--verbose" to the calabash-gradle command that it spawns. I have created a fork and a pull request with a change to the gradle-calabash-android-plugin project to address this issue: github.com/Pedlar/gradle-calabash-android-plugin/pull/6</p>
  
  <p>After I use the new version of gradle-calabash-android-plugin I got useful debug output:</p>
  
  <pre><code>15:29:02.455 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command 'cmd''
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - JDK found on PATH.
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - JDK found at: C:\Program Files\Java\jdk1.8.0
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - Android SDK found at: C:\AndroidSDK\adt-bundle-windows-x86_64-20140321\adt-bundle-windows-x86_64-20140321\sdk
  15:29:03.608 [QUIET] [system.out] No test server found for this combination of app and calabash version. Recreating test server.
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - "\Program Files\Java\jdk1.8.0\bin/keytool.exe" -v -printcert -J"-Dfile.encoding=utf-8" -file "C:/Windows/Temp/d20140423-5912-102klgo/META-INF/CERT.RSA"
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - MD5 fingerprint for signing cert (C:/Users/jenkins/.jenkins/jobs/Toasty/workspace/build/apk/workspace-debug-unaligned.apk): 11:FC:53:97:85:19:6C:2F:FA:AF:00:B4:DC:A1:68:1E
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - C:/Users/jenkins/.jenkins/jobs/Toasty/workspace/build/apk/workspace-debug-unaligned.apk was signed with a certificate with fingerprint 11:FC:53:97:85:19:6C:2F:FA:AF:00:B4:DC:A1:68:1E
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - Trying to read keystore from: C:/Windows/system32/config/systemprofile/.android/debug.keystore - no such file
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - Trying to read keystore from: C:/Users/jenkins/.jenkins/jobs/Toasty/workspace/debug.keystore - no such file
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - Trying to read keystore from: C:/Windows/system32/config/systemprofile/.local/share/Xamarin/Mono/ for/ Android/debug.keystore - no such file
  15:29:03.608 [QUIET] [system.out] 2014-04-23 15:29:03 - Trying to read keystore from: C:/Windows/system32/config/systemprofile/AppData/Local/Xamarin/Mono for Android/debug.keystore - no such file
  15:29:03.608 [QUIET] [system.out] No keystores found.
  </code></pre>
  
  <p>Now I am not sure why calabash-android is trying to read the keystore from "C:/Windows/system32/config/systemprofile/.android/debug.keystore" instead of "C:/Users/jenkins/.android/debug.keystore". I have jenkins running as a windows system service using the login credentials for a user named jenkins on the server.</p>
  
  <p>So I added a file C:\Windows\system32\config\systemprofile.android\debug.keystore. Still getting the same error which is odd.</p>
  
  <p>I am new to developing on windows platform so it could be something as trivial as a silly white space or slash direction issue but I have not been able to figure it out. Thanks for any help.</p>