我坚持上述问题。在作为AWS Linux机器的CI服务器中构建时,我遇到了这个问题。有趣的是,只有当Android Emulator在后台运行时,Job才会失败。我正在运行一个基于ARM的仿真器无头。
我尝试过针对类似问题提到的所有其他解决方案。尝试使用gradle.properties中的jvmargs,将Multidex设置为True,将javaMaxHeapSize设置为4g。我仍然看到错误。
请在下面找到堆栈跟踪。
失败:构建因异常而失败。
出了什么问题: 任务执行失败':app:transformClassesWithDexForQaDebug'。
com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException
尝试: 使用--debug选项运行以获得更多日志输出。
例外情况是: org.gradle.api.tasks.TaskExecutionException:任务':app:transformClassesWithDexForQaDebug'执行失败。 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) 在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 在org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) 在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66) 在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) 在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) 在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) 在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) 在org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) 在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 在org.gradle.execution.DefaultBuildExecuter.access $ 000(DefaultBuildExecuter.java:23) 在org.gradle.execution.DefaultBuildExecuter $ 1.proceed(DefaultBuildExecuter.java:43) 在org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) 在org.gradle.initialization.DefaultGradleLauncher $ 4.run(DefaultGradleLauncher.java:153) 在org.gradle.internal.Factories $ 1.create(Factories.java:22) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53) 在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150) 在org.gradle.initialization.DefaultGradleLauncher.access $ 200(DefaultGradleLauncher.java:32) 在org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher.java:98) 在org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher.java:92) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63) 在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92) 在org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83) at org.gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.run(InProcessBuildActionExecuter.java:99) 在org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) 在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48) 在org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30) 在org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81) 在org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46) 在org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51) 在org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28) 在org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) 在org.gradle.internal.Actions $ RunnableActionAdapter.execute(Actions.java:173) 在org.gradle.launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:239) 在org.gradle.launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:212) 在org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) 在org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) 在org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 在org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 在org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:205) 在org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:169) 在org.gradle.launcher.Main.doAction(Main.java:33) 在org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 在org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55) 在org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36) 在org.gradle.launcher.GradleMain.main(GradleMain.java:23) 引起:java.lang.RuntimeException:com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException 在com.android.builder.profile.Recorder $ Block.handleException(Recorder.java:54) 在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:158) 在com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173) 在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245) 在org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) 在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ......还有57个 引起:com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException 在com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:443) 在com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:178) 在com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:174) 在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) ......还有65个 引起:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException 在com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:210) 在com.android.builder.core.DexByteCodeConverter.runDexer(DexByteCodeConverter.java:159) 在com.android.builder.core.DexByteCodeConverter.convertByteCode(DexByteCodeConverter.java:146) 在com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1422) 在com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:272) ......还有68个 引起:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException 在com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:206) ......还有72个 引起:java.lang.UnsupportedOperationException 在com.android.ide.common.process.ProcessInfoBuilder $ JavaProcessInfoImpl.getExecutable(ProcessInfoBuilder.java:349) at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74) 在com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49) 在com.android.builder.core.DexByteCodeConverter.lambda $ dexOutOfProcess $ 1(DexByteCodeConverter.java:196)