TaskExecutionException

TaskExecutionException

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

问题描述

我是Android Studio新手,我一直在使用eclipse,但由于我的项目中出现 65K 错误,我需要将其迁移到Android Studio。在运行时

我收到错误消息: -

 任务执行失败':app:transformClassesWithDexForDebug'。 
com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:org。 gradle.process.internal.ExecException:进程'命令'/opt/jdk/jdk1.8.0_45/bin/java''以非零退出值1


我知道这是将eclipse项目迁移到Android Studio时非常常见的错误。



并且相信我我搜索了很多有相同问题的链接,并尝试了他们在答案中提到的所有内容,但是没有为我工作



以下是我得到的链接: -















以及更多



我尝试了每一个解决方案,我试图在我的项目中逐个添加 .jar 文件,我只使用那些在我的项目中使用的Google服务包,我甚至添加了 multidex jar.But没有什么可以帮助我



这是我的Build.gradle文件: -

 申请插件:'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion23.0.3

defaultConfig {
applicationIdcom.petzview.android
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
lintOptions {
ab ortOnError false
checkReleaseBuilds false
}

dexOptions {
incremental = true;
maxProcessCount 4
javaMaxHeapSize4g
dexInProcess = false
preDexLibraries = false
}
}

依赖项{
编译fileTree(包括:['* .jar'],dir:'libs')
testCompile'junit:junit:4.12'
compile'c​​om.android.support:appcompat-v7:23.4 .0'
编译'com.google.android.gms:play-services-ads:9.0.0'
compile'c​​om.google.android.gms:play-services-plus:9.0.0 '
compile'c​​om.google.android.gms:play-services-gcm:9.0.0'
编译项目(':AVIOCtrlDefine')
编译项目(':Facebook')
编译项目(':SlidingMenu-master')
编译'com.android.support:multidex:1.0.1'
}
android.packagingOptions {
exclude' META-INF / DEPENDENCIES'
排除'META-INF / DEPENDENCIES.txt'
排除'META-INF / LICENSE'
排除'META-INF / LICENSE.txt'
排除'META-INF / license.txt'
排除'META-INF / NOTICE'
排除'META-INF / NOTICE.txt'
排除' META-INF / NOTICE.txt'
排除'META-INF / ASL2.0'
排除'META-INF / Services / javax.annotation.processing.Processor'
}
申请插件:'com.google.gms.google-services'

我的主要gradle文件: -

  buildscript {
repositories {
jcenter()
}
依赖项{
classpath'com.android.tools.build:gradle:2.1.0'
classpath'com.google.gms:google-services:3.0.0'
}
}

allprojects {
repositories {
jcenter()
}
}

这里我附上我的libs文件夹的屏幕截图: -





这是我的MyApplication.java类: -

 公共类MyApplication扩展MultiDexApplication {
private Object mTempObject = null;

private boolean flagHomeFragmentFirstCreate = true;

@Override
protected void attachBaseContext(Context base){
super.attachBaseContext(base);
MultiDex.install(this);
FacebookSdk.sdkInitialize(getApplicationContext());
}

我的Manifest类包含MyApplication: -



 < application android:name =。MyApplicationandroid:allowBackup =true android:icon =@ drawable / ic_launcherandroid:label =@ string / app_nameandroid:largeHeap =trueandroid:theme =@ style / AppTheme>  



运行后

我得到了这个: -



错误日志

  org.gradle.api.tasks.TaskExecutionException:任务执行失败':应用:transformClassesWithDexForDebug。 
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter。 java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter。执行(SkipUpToDateTaskExecuter.java:64)
org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks。 execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api。 internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.intern al.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle。 execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle。 execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution。 taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:37)
at org.gradle.execution.DefaultBuildExecuter.access $ 000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter $ 1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle .execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher $ 4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories $ 1.create (Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java) :52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLau ncher.access $ 200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher $ 1.create(DefaultGradleLauncher) .java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62 )
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org。 gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org。 gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.la uncher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec。 ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute( DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java: 43)
at org.gradle.internal.Actions $ RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLin eActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction。执行(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging。执行(CommandLineActionFactory.java:169)
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction。 java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBoot) strap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
引起:java.lang .RuntimeException:
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:处理'命令
'/opt/jdk/jdk1.8.0_45/bin/java'' com.android.builder.profile.Recorder $ Block.handleException(Recorder.java:54)
at com.android.builder.profile.ThreadRecorder $ 1.record以非零退出值1
结束(ThreadRecorder.java:57)
at com.android.builder.profile.ThreadRecorder $ 1.record(ThreadRecorder.java:47)
at com.android.build.g radle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api。 internal.project.taskfactory.AnnotationProcessingTaskFactory $ IncrementalTask​​Action.doExecute(AnnotationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ IncrementalTask​​Action.execute(AnnotationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory) .java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter .executeActions(ExecuteActionsTaskE xecuter.java:61)
... 60更多引起:com.android.build.api.transform.TransformException:> com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process。 internal.ExecException:进程'命令
'/ opt / jdk / jdk1.8.0_45 / bin / java''在com.android.build.gradle.internal中以非零退出值1
结束。变换.DexTransform.transform(DexTransform.java:421)
at com.android.build.gradle.internal.pipeline.TransformTask $ 3.call(TransformTask.java:178)
at com.android.build .gradle.internal.pipeline.TransformTask $ 3.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder $ 1.record(ThreadRecorder.java:55)
... 69更多原因:com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org。 gradle.process.internal.ExecException:进程'命令
'/ opt / jdk / jdk1.8.0_45 / bin / java''以非零退出va结束lue 1
com.android.builder.core.AndroidBuilder.dexOutOfProcess(AndroidBuilder.java:1553)
at com.android.builder.core.AndroidBuilder.runDexer(AndroidBuilder.java:1495)
at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1482)
at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:251)
... 72更多引起:java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:Process'命令
'/ opt / jdk / jdk1.8.0_45 / bin / java''在com.android.builder.core.AndroidBuilder.dexOutOfProcess(AndroidBuilder.java:)中以非零退出值1
结束。 1549)
... 75更多引起:com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:处理'命令
'/ opt /jdk/jdk1.8.0_45/bin/java''在com.android.build.gr上以非零退出值1
结束adle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:43)
at com.android.builder.core.AndroidBuilder $ 3.call(AndroidBuilder.java:1538)
at com.android.builder .core.AndroidBuilder $ 3.call(AndroidBuilder.java:1531)
引起:org.gradle.process.internal.ExecException:处理'命令
'/opt/jdk/jdk1.8.0_45/bin / java''在org.gradle.process.internal.DefaultExecHandle $ ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
的com.android.build.gradle中以非零退出值1
结束。 internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:41)
... 2更多

在设备上运行应用程序时出错: -


请查看一次,如果我在某些地方出错,请告诉我,我我被困在过去3天



先谢谢

解决方案

检查 build.gradle (模块:Android)修复了我的问题。



将其修改为可行的版本。

  android {
buildToolsVersion '23 .0.1'
}


I am new to Android Studio ,I always worked on eclipse, but due to 65K error in my project I need it to migrate to Android Studio . While running

i am getting error saying :-

Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1

I Know this is very common error which all get while migrating eclipse project to Android Studio.

And Believe me I searched alot many links having same problem and tried every thing they mentioned in their answers , but nothings works for me

Here are the links i got :-

Execution failed for task ':app:transformClassesWithDexForDebug' - Gradle dependencies?

Execution failed for task ':app:transformClassesWithDexForDebug' while implementing Google sign in for Android

Android Studio TransformException : Error:Execution failed for task ':app:transformClassesWithDexForDebug'

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

com.android.build.transform.api.TransformException

https://github.com/journeyapps/zxing-android-embedded/issues/110

and many more

I tried every solution, I tried to add .jar files one by one in my project, I used only those Google-services packages which are getting used in my project, I even added multidex jar.But nothing helps me

here is my Build.gradle file :-

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.petzview.android"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
        checkReleaseBuilds false
    }

    dexOptions {
        incremental = true;
        maxProcessCount 4
        javaMaxHeapSize "4g"
        dexInProcess = false
        preDexLibraries = false
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-ads:9.0.0'
    compile 'com.google.android.gms:play-services-plus:9.0.0'
    compile 'com.google.android.gms:play-services-gcm:9.0.0'
    compile project(':AVIOCtrlDefine')
    compile project(':Facebook')
    compile project(':SlidingMenu-master')
    compile 'com.android.support:multidex:1.0.1'
}
android.packagingOptions {
    exclude 'the META-INF / DEPENDENCIES'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'the META-INF / LICENSE'
    exclude 'the META-INF / LICENSE.txt'
    exclude 'the META-INF / license.txt'
    exclude 'the META-INF / NOTICE'
    exclude 'the META-INF / the NOTICE.txt '
    exclude ' the META-INF / NOTICE.txt '
    exclude ' the META-INF / ASL2.0 '
    exclude ' the META-INF / Services / javax.annotation.processing.Processor '
}
apply plugin: 'com.google.gms.google-services'

My main gradle file :-

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
       classpath 'com.android.tools.build:gradle:2.1.0'
       classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

here I am attaching screen-shot of my libs folder :-

Here is my MyApplication.java class :-

public class MyApplication extends MultiDexApplication {
    private Object mTempObject = null;

    private boolean flagHomeFragmentFirstCreate = true;

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
        FacebookSdk.sdkInitialize(getApplicationContext());
    }

My Manifest class containing MyApplication :-

 <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppTheme">

After running

I got this :-

Error Log

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at 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)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
         org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException:
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:54)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:57)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
         ... 60 more Caused by: com.android.build.api.transform.TransformException:> com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:421)
at com.android.build.gradle.internal.pipeline.TransformTask$3.call(TransformTask.java:178)
at com.android.build.gradle.internal.pipeline.TransformTask$3.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
         ... 69 more Caused by: com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
at com.android.builder.core.AndroidBuilder.dexOutOfProcess(AndroidBuilder.java:1553)
at com.android.builder.core.AndroidBuilder.runDexer(AndroidBuilder.java:1495)
at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1482)
 at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:251)
         ... 72 more Caused by: java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
at com.android.builder.core.AndroidBuilder.dexOutOfProcess(AndroidBuilder.java:1549)
        ... 75 more Caused by: com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:43)
at com.android.builder.core.AndroidBuilder$3.call(AndroidBuilder.java:1538)
at com.android.builder.core.AndroidBuilder$3.call(AndroidBuilder.java:1531)
Caused by: org.gradle.process.internal.ExecException: Process 'command
 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:41)
         ... 2 more

Error while running application on device :-

Please review it once and let me know if I am going wrong some where, I am stuck from past 3 days

Thanks in Advance

解决方案

Check build.gradle(Module: Android) fixed problem for me.

Modify it to workable version.

android {
    buildToolsVersion '23.0.1'
}

这篇关于org.gradle.api.tasks.TaskExecutionException:任务':app:transformClassesWithDexForDebug'的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 05:02