CircleCI在UnitTest步骤中运行失败。

huangapple go评论84阅读模式
英文:

CircleCI android run fail at UnitTest step

问题

以下是翻译好的部分:

昨天早上之前一切都运行良好,UnitTest 步骤失败了,即使在我的本地机器上使用相同的命令 ./gradlew testDevelopDebugUnitTest 也通过了。

我尝试在 CircleCI 配置中的命令中添加 --debug 选项,日志如下(我删除了一些日志):

10:01:55.996 [DEBUG] [ComponentAttributeMatcher] 已从候选项 [org.jdom:jdom2:2.0.6 configuration runtime] 中选择匹配项 org.jdom:jdom2:2.0.6 配置运行时,用于 {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
10:01:55.996 [DEBUG] [ComponentAttributeMatcher] 已从候选项 [commons-logging:commons-logging:1.2 configuration runtime] 中选择匹配项 commons-logging:commons-logging:1.2 配置运行时,用于 {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
10:01:55.996 [DEBUG] [ComponentAttributeMatcher] 已从候选项 [commons-codec:commons-codec:1.10 configuration runtime] 中选择匹配项 commons-codec:commons-codec:1.10 配置运行时,用于 {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
10:01:55.996 [DEBUG] [ComponentAttributeMatcher] 已从候选项 [org.apache.commons:commons-compress:1.12 configuration runtime] 中选择匹配项 org.apache.commons:commons-compress:1.12 配置运行时,用于 {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}

//.... 许多调试日志

10:01:56.611 [ERROR] [BuildExceptionReporter] 
10:01:56.612 [ERROR] [BuildExceptionReporter] 失败: 任务构建失败。
10:01:56.612 [ERROR] [BuildExceptionReporter] 
10:01:56.612 [ERROR] [BuildExceptionReporter] * 失败原因:
10:01:56.612 [ERROR] [BuildExceptionReporter] 执行任务 ':app:kaptDevelopDebugKotlin' 时出现失败。
10:01:56.612 [ERROR] [BuildExceptionReporter] > 在执行 org.jetbrains.kotlin.gradle.internal.KaptExecution 时发生故障
10:01:56.612 [ERROR] [BuildExceptionReporter]    > java.lang.reflect.InvocationTargetException(没有错误消息)
//... 更多错误信息

我现在被困在这个问题上,我的猜测是 jvm version: org.gradle.jvm.version=11 是错误的(您可以在调试日志中看到)。我的本地机器上运行的是:

匹配的 Java 虚拟机(1): 1.8.0_222, x86_64

我是不是正确的?因为在 CircleCI 文档中写道 CircleCI 的 Android 镜像基于 openjdk:8-jdk 官方 Docker 镜像

我应该如何在 CircleCI 中设置与我的本地机器运行相同的版本?

英文:

Everything works well until yesterday morning, the UnitTest step is failed, even it's passed in my local machine with same command ./gradlew testDevelopDebugUnitTest.

I try to add --debug option to the command in CircleCI config, the logs are below (I removed some of logs):

10:01:55.996 [DEBUG] [ComponentAttributeMatcher] Selected match org.jdom:jdom2:2.0.6 configuration runtime from candidates [org.jdom:jdom2:2.0.6 configuration runtime] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
10:01:55.996 [DEBUG] [ComponentAttributeMatcher] Selected match commons-logging:commons-logging:1.2 configuration runtime from candidates [commons-logging:commons-logging:1.2 configuration runtime] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
10:01:55.996 [DEBUG] [ComponentAttributeMatcher] Selected match commons-codec:commons-codec:1.10 configuration runtime from candidates [commons-codec:commons-codec:1.10 configuration runtime] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
10:01:55.996 [DEBUG] [ComponentAttributeMatcher] Selected match org.apache.commons:commons-compress:1.12 configuration runtime from candidates [org.apache.commons:commons-compress:1.12 configuration runtime] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime}
//.... many debug logs
10:01:56.611 [ERROR] [BuildExceptionReporter] 
10:01:56.612 [ERROR] [BuildExceptionReporter] FAILURE: Build failed with an exception.
10:01:56.612 [ERROR] [BuildExceptionReporter] 
10:01:56.612 [ERROR] [BuildExceptionReporter] * What went wrong:
10:01:56.612 [ERROR] [BuildExceptionReporter] Execution failed for task ':app:kaptDevelopDebugKotlin'.
10:01:56.612 [ERROR] [BuildExceptionReporter] > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
10:01:56.612 [ERROR] [BuildExceptionReporter]    > java.lang.reflect.InvocationTargetException (no error message)
10:01:56.612 [ERROR] [BuildExceptionReporter] 
10:01:56.612 [ERROR] [BuildExceptionReporter] * Try:
10:01:56.612 [ERROR] [BuildExceptionReporter]  Run with --scan to get full insights.
10:01:56.613 [ERROR] [BuildExceptionReporter] 
10:01:56.613 [ERROR] [BuildExceptionReporter] * Exception is:
10:01:56.613 [ERROR] [BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:kaptDevelopDebugKotlin'.
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
10:01:56.614 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
10:01:56.615 [ERROR] [BuildExceptionReporter] Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.workers.internal.DefaultWorkerExecutor$WorkerExecution.waitForCompletion(DefaultWorkerExecutor.java:285)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:115)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultAsyncWorkTracker.access$000(DefaultAsyncWorkTracker.java:34)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultAsyncWorkTracker$2.run(DefaultAsyncWorkTracker.java:83)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.Factories$1.create(Factories.java:25)
10:01:56.615 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:254)
10:01:56.617 [ERROR] [BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:120)
10:01:56.617 [ERROR] [BuildExceptionReporter] 	... 35 more
10:01:56.617 [ERROR] [BuildExceptionReporter] Caused by: java.lang.reflect.InvocationTargetException
10:01:56.617 [ERROR] [BuildExceptionReporter] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:01:56.617 [ERROR] [BuildExceptionReporter] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
10:01:56.617 [ERROR] [BuildExceptionReporter] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
10:01:56.617 [ERROR] [BuildExceptionReporter] 	at org.jetbrains.kotlin.gradle.internal.KaptExecution.run(KaptWithoutKotlincTask.kt:158)
10:01:56.617 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	... 3 more
10:01:56.618 [ERROR] [BuildExceptionReporter] Caused by: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1200)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1233)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1224)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.doLoadProcessors(ProcessorLoader.kt:80)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors(ProcessorLoader.kt:45)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	at org.jetbrains.kotlin.kapt3.base.Kapt.kapt(Kapt.kt:42)
10:01:56.618 [ERROR] [BuildExceptionReporter] 	... 25 more
10:01:56.618 [ERROR] [BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
10:01:56.618 [ERROR] [BuildExceptionReporter] 	... 31 more
10:01:56.618 [ERROR] [BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
10:01:56.618 [ERROR] [BuildExceptionReporter] 	... 31 more
10:01:56.618 [ERROR] [BuildExceptionReporter] 
10:01:56.618 [ERROR] [BuildExceptionReporter] 
10:01:56.618 [ERROR] [BuildExceptionReporter] * Get more help at https://help.gradle.org

I am now stuck with this issue, my guess is the jvm version: org.gradle.jvm.version=11 is incorrect (you can see in debug log). My local machine is run with

Matching Java Virtual Machines (1): 1.8.0_222, x86_64

Am I correct? Because in CircleCI docs The CircleCI Android image is based on the openjdk:8-jdk official Docker image.

How can I set the CircleCI run the same version with my local machine?

答案1

得分: 3

安卓镜像已更新至 Java v11。

请参阅此讨论串,位于 CircleCi 讨论区。

英文:

The Android image has moved to Java v11.

Please see this thread on CircleCi Discuss.

huangapple
  • 本文由 发表于 2020年8月19日 19:05:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/63485630.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定