transformClassesWithDexForDebug

transformClassesWithDexForDebug

本文介绍了TransformException:错误:任务“:app:transformClassesWithDexForDebug"的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在布局中将列表视图转换为回收器视图并且将适配器从基本适配器更改为回收器视图适配器后出现此错误

错误:任务:app:transformClassesWithDexForDebug"的执行失败.

com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理命令"/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java''以非零退出值1结束

这就是我在日志中得到的内容

 14:38:32.582 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] 完成执行任务 ':app:transformClassesWithDexForDebug'14:38:32.582 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:transformClassesWithDexForDebug 失败14:38:32.584 [信息] [org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor] :app:transformClassesWithDexForDebug (Thread[main,5,main]) 完成.耗时 41.484 秒.14:38:32.584 [DEBUG] [org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor] Task worker [Thread[main,5,main]] 完成,忙:2 分 9.57 秒,空闲:0.244 秒14:38:32.598 [错误] [org.gradle.BuildExceptionReporter]14:38:32.599 [错误] [org.gradle.BuildExceptionReporter] 失败:构建失败,出现异常.14:38:32.600 [错误] [org.gradle.BuildExceptionReporter]14:38:32.600 [错误] [org.gradle.BuildExceptionReporter] * 出了什么问题:14:38:32.600 [ERROR] [org.gradle.BuildExceptionReporter] 任务:app:transformClassesWithDexForDebug"执行失败.14:38:32.600 [错误] [org.gradle.BuildExceptionReporter] >com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'命令'/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' 以非零退出值 1 结束14:38:32.601 [错误] [org.gradle.BuildExceptionReporter]14:38:32.601 [错误] [org.gradle.BuildExceptionReporter] * 异常是:14:38:32.603 [错误] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException:任务:app:transformClassesWithDexForDebug"执行失败.14:38:32.604 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)14:38:32.604 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)14:38:32.605 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)14:38:32.605 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)14:38:32.605 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)14:38:32.605 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)14:38:32.605 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)14:38:32.605 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)14:38:32.606 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)14:38:32.606 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)14:38:32.606 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)14:38:32.606 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)14:38:32.607 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)14:38:32.607 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)14:38:32.607 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)14:38:32.607 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)14:38:32.608 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.internal.Factories$1.create(Factories.java:22)14:38:32.613 [错误] [org.gradle.BuildExceptionReporter] 在 org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

我试图清理我的项目,并且我已经为我的项目添加了 mutlidex 支持有什么帮助吗?

解决方案

在尝试了此问题上可用的所有方法后都没有成功
我已经解决了我的问题将我的适配器类回滚到它们的原始状态并创建新类,我知道这不是解决方案,但我无法以其他方式解决此问题

i'm getting this error after i converted list view to recycler view in my layout and i changed the adapter from base adapter to recycler view adapter

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

thats the what i m getting in log

    14:38:32.582 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:transformClassesWithDexForDebug'
14:38:32.582 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:transformClassesWithDexForDebug FAILED
14:38:32.584 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:transformClassesWithDexForDebug (Thread[main,5,main]) completed. Took 41.484 secs.
14:38:32.584 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 2 mins 9.57 secs, idle: 0.244 secs
14:38:32.598 [ERROR] [org.gradle.BuildExceptionReporter]
14:38:32.599 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:38:32.600 [ERROR] [org.gradle.BuildExceptionReporter]
14:38:32.600 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
14:38:32.600 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app:transformClassesWithDexForDebug'.
14:38:32.600 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
14:38:32.601 [ERROR] [org.gradle.BuildExceptionReporter]
14:38:32.601 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:38:32.603 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexForDebug'.
14:38:32.604 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
14:38:32.604 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
14:38:32.605 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
14:38:32.605 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
14:38:32.605 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
14:38:32.605 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
14:38:32.605 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
14:38:32.605 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
14:38:32.606 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
14:38:32.606 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
14:38:32.606 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
14:38:32.606 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)
14:38:32.607 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
14:38:32.607 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
14:38:32.607 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
14:38:32.607 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
14:38:32.608 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.Factories$1.create(Factories.java:22)
14:38:32.613 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

i tried to clean my project and i have added mutlidex support for my projectany help ?

解决方案

After trying every things available on this issue with no luck
i have fixed my problem rollback my adapter classes to their original state and create new classes, i know that's not a solution but i couldn't fix this in another way

这篇关于TransformException:错误:任务“:app:transformClassesWithDexForDebug"的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 05:06