CircleCI android 运行 在单元测试步骤失败
CircleCI android run fail at UnitTest step
一切正常,直到昨天早上,UnitTest step
失败了,即使它是通过相同的命令 ./gradlew testDevelopDebugUnitTest
.
传递到我的本地机器中的
我尝试在 CircleCI config
中的命令中添加 --debug
选项,日志如下(我删除了一些日志):
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.accept(ExecuteActionsTaskExecuter.java:151)
10:01:56.614 [ERROR] [BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.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.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[=12=]0(DefaultAsyncWorkTracker.java:34)
10:01:56.615 [ERROR] [BuildExceptionReporter] at org.gradle.internal.work.DefaultAsyncWorkTracker.run(DefaultAsyncWorkTracker.java:83)
10:01:56.615 [ERROR] [BuildExceptionReporter] at org.gradle.internal.Factories.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
我现在被这个问题困住了,我的猜测是 jvm version: org.gradle.jvm.version=11
不正确(您可以在调试日志中看到)。我的本地机器是 运行 和
Matching Java Virtual Machines (1): 1.8.0_222, x86_64
我说的对吗?因为在 CircleCI 文档中 The CircleCI Android image is based on the openjdk:8-jdk official Docker image
.
如何设置 CircleCI
运行 与本地机器相同的版本?
Android 图像已移至 Java v11。
请参阅 CircleCi 讨论 this thread。
一切正常,直到昨天早上,UnitTest step
失败了,即使它是通过相同的命令 ./gradlew testDevelopDebugUnitTest
.
我尝试在 CircleCI config
中的命令中添加 --debug
选项,日志如下(我删除了一些日志):
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.accept(ExecuteActionsTaskExecuter.java:151)
10:01:56.614 [ERROR] [BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.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.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[=12=]0(DefaultAsyncWorkTracker.java:34)
10:01:56.615 [ERROR] [BuildExceptionReporter] at org.gradle.internal.work.DefaultAsyncWorkTracker.run(DefaultAsyncWorkTracker.java:83)
10:01:56.615 [ERROR] [BuildExceptionReporter] at org.gradle.internal.Factories.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
我现在被这个问题困住了,我的猜测是 jvm version: org.gradle.jvm.version=11
不正确(您可以在调试日志中看到)。我的本地机器是 运行 和
Matching Java Virtual Machines (1): 1.8.0_222, x86_64
我说的对吗?因为在 CircleCI 文档中 The CircleCI Android image is based on the openjdk:8-jdk official Docker image
.
如何设置 CircleCI
运行 与本地机器相同的版本?
Android 图像已移至 Java v11。
请参阅 CircleCi 讨论 this thread。