gpt4 book ai didi

android - calabash-android 在 Jenkins 下运行时给出 "No keystores found."

转载 作者:行者123 更新时间:2023-11-30 02:56:03 25 4
gpt4 key购买 nike

我有一个简单的测试 android 项目,我可以在以我自己身份登录的 DOS shell 中使用“.\gradlew calabashDebug”进行测试。但是,当我在持续集成服务器上的 Jenkins 下运行该项目时,它失败并显示“未找到 keystore ”。错误(请参阅下面的堆栈跟踪)。

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] > 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

问题是没有指示默认情况下 keystore 的位置。我试过将 keystore 放在 JENKINS_HOME 目录下的 .android\debug.keystore 中。我还尝试使用以下内容放置一个 calabash_settings 文件(以及一个 .calabash_settings 文件):

{"keystore_location":"C:\\Program Files (x86)\\Jenkins\\.android\\debug.keystore","keystore_password":"android","keystore_alias":"androiddebugkey"}

我发现一个问题是我在 build.gradle 中使用的 gradle-calabash-android-plugin 没有为它生成的 calabash-gradle 命令指定“-v”或“--verbose”。我创建了一个 fork 和一个拉取请求,并更改了 gradle-calabash-android-plugin 项目来解决这个问题:github.com/Pedlar/gradle-calabash-android-plugin/pull/6

在我使用新版本的 gradle-calabash-android-plugin 之后,我得到了有用的调试输出:

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.

现在我不确定为什么 calabash-android 试图从“C:/Windows/system32/config/systemprofile/.android/debug.keystore”而不是“C:/Users/jenkins/.android”读取 keystore /debug.keystore”。我使用服务器上名为 jenkins 的用户的登录凭据将 jenkins 作为 Windows 系统服务运行。

所以我添加了一个文件C:\Windows\system32\config\systemprofile.android\debug.keystore。仍然出现相同的错误,这很奇怪。

我是 Windows 平台上开发的新手,所以它可能像愚蠢的空白或斜杠方向问题一样微不足道,但我一直无法弄清楚。感谢您的帮助。

最佳答案

事实证明,我最初的大部分问题源于我将 Jenkins 安装为以本地系统帐户运行的服务(请参阅服务属性中的登录选项卡)。这导致 Jenkins 在各种系统目录中读取/写入内容,并可能遇到一些权限问题。

解决方案是:

  1. 删除jenkins windows服务
  2. 在服务器上创建一个jenkins本地账号
  3. 以新的 jenkins 用户身份登录,这次以 jenkins 用户身份重新安装 jenkins
  4. 配置 jenkins 时确保使用服务属性/登录/此帐户/.\jenkins
  5. 确保在所有完成后重新启动服务

这是我最后忘记做的最后一步 - Doh!一旦我这样做了,一切都很好!

关于android - calabash-android 在 Jenkins 下运行时给出 "No keystores found.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23243943/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com