繁体   English   中英

Android Studio Build失败,异常执行失败':app:dexDebug'

Android Studio Build failed with an exception Execution failed for task ':app:dexDebug'

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文繁体   英文版本   中英对照 版本,有任何建议请联系yoyou2525@163.com。

控制台日志:

失败

FAILURE:构建因异常而失败。

  • 出了什么问题:任务':app:dexDebug'执行失败。

    com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\\ Program Files(x86)\\ Java \\ jdk1.8.0 \\ bin \\ java.exe''已完成非零退出值2

  • 尝试:使用--info或--debug选项运行以获取更多日志输出。

  • 例外情况是:org.gradle.api.tasks.TaskExecutionException:任务':app:dexDebug'的执行失败。 在org.gradle上的org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) .api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)在org.gradle.api.internal .tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)在org.gradle.api.internal.tasks.execution .skipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecu at.exe.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)中的ter.execute(ExecuteAtMostOnceTaskExecuter.java:43)org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)在org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)在org.gradle.execution.taskgraph.Abs​​tractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)在org.gradle.execution.taskgraph .DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)在org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)在有机grag.exe.exe.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)org.gradle.execution.DefaultBuildExecuter.access $ 200(DefaultBuildExecuter.java:23)org.gradle.executio n.DefaultBuildExecuter $ 2.proceed(DefaultBuildExecuter.java:68)org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)at org。 grag.exe.exe.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)at org .gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)org.gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.run(InProcessBuildActionExecuter.java:80)at org.gradle.tooling.internal.provider.BuildModelAction.run (BuildModelAction.java:43)org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:30)atg.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:119)at at组织 .gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)at org.gradle.launcher.daemon.server.exec.ExecuteBuild .doBuild(ExecuteBuild.java:47)org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution) .java:119)org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) )org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)org。 gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndSto p.java:33)org.gradle.launcher.daemon.server.exe.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java) :71)在org.gradle.launcher的org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:69)atg.gradle.util.Swapper.swap(Swapper.java:38)位于org.gradle.launcher.daemon.server的org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)的.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)位于org.gradle.launcher.daemon.serverec.DaemonCommandExecution的org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)上的.exec.LogToClient.doBuild(LogToClient.java:60) .proceed(DaemonCommandExecution.java:119)位于org.gradle.launcher.daemon.server.exec.Buil的org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70) dCommandOnly.execute(BuildCommandOnly.java:34)org.gradle.launcher.daemon.server.exe.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute( daemonHygieneAction.java:39)org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1.run(StartBuildOrRespondWithBusy.java) :46)org.gradle.launcher.daemon.server.DaemonStateCoordinator $ 1.run(DaemonStateCoordinator.java:246)at org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64)引起: org.gradle.internal.UncheckedException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\\ Program Files(x86)\\ Java \\ jdk1.8.0 \\ bin \\ java.exe''在org.gradle.internal.UncheckedException.throwAsUncheckedExcept中以非零退出值2结束 离开(UncheckedException.java:39)atg.gradle.internal.refideo.JavaMethod.invoke(JavaMethod.java:66)org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ IncrementalTask​​Action.doExecute(AnnotationProcessingTaskFactory.java: 235)atg.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ IncrementalTask​​Action.execute(AnnotationProcessingTaskFactory.java: 222)在org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)... 55更多引起:com.android.ide.common.process.Proc essException:org.gradle.process.internal.ExecException:进程'命令'C:\\ Program Files(x86)\\ Java \\ jdk1.8.0 \\ bin \\ java.exe''在com.android中以非零退出值2结束com.android.builder.core.AndroidBuilder上的com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1193)中的.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:42)$ convertByteCode com.android.build.gradle.tasks.Dex.doTaskAction(Dex.groovy:151)在com.android.build.gradle.tasks.Dex.this $ 5 $ doTaskAction(Dex.groovy)的$ 0.call(未知来源)在com.android.build.gradle.tasks.Dex $这个$ 5 $ doTaskAction.callCurrent(未知来源)at com.android.build.gradle.tasks.Dex.taskAction(Dex.groovy:90)at org.gradle.internal .reflect.JavaMethod.invoke(JavaMethod.java:63)... 61更多引起:org.gradle.process.internal.ExecException:处理'命令'C:\\ Program Files(x86)\\ Java \\ jdk1.8.0 \\ bin \\ java.exe''在org.gradle.process.inte中以非零退出值2结束 rnal.DefaultExecHandle $ ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:365)at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:40)... 68 more

build.gradle文件:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.0"

    defaultConfig {
        applicationId "com.appdomain.appname"
        minSdkVersion 15
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    }

    dependencies {
        compile 'com.android.support:support-v4:19.1.+'
        compile 'com.google.guava:guava:10.0.1'
        compile 'com.google.android.gms:play-services:+'
        compile 'com.android.support:appcompat-v7:21.0.3'
        compile files('libs/gdata-client-1.0.jar')
        compile files('libs/gdata-client-meta-1.0.jar')
        compile files('libs/gdata-contacts-3.0.jar')
        compile files('libs/gdata-contacts-meta-3.0.jar')
        compile files('libs/gdata-core-1.0.jar')
        compile files('libs/libGoogleAnalyticsServices.jar')
        compile files('libs/mpandroidchartlibrary-1-7-4.jar')
        compile files('libs/recyclerview.jar')
    }
3 个回复

我找到了解决方案

只是改变

compile 'com.android.support:support-v4:19.1.+'

compile 'com.android.support:support-v4:22.0.0'

也改变了

compile 'com.android.support:appcompat-v7:21.0.3'

compile 'com.android.support:appcompat-v7:22.0.0'

并在build.gradle文件中使用Multi-dex属性,如下所示:

defaultConfig {
    applicationId "com.sendpulse.sendpulse"
    minSdkVersion 15
    targetSdkVersion 21
    multiDexEnabled true

}

然后清理项目并重建

我也有类似的问题。 我取出每个罐子并逐个检查,直到我找到它。
基本上这个问题是由jar文件引起的。 所以,试试这个,把你的jar文件一个接一个地放在依赖项中并测试。你很容易得到修复。

  1. 做项目清理。 转到Build-> Clean Project并再试一次
  2. 如果(1)不起作用,请关闭并重新启动编译器。
  3. 快速检查Build.Grade文件,确保只保留重要文件,并删除未使用的文件。
  4. 如果所有其他方法都失败了,请将“multiDexEnabled true”添加到您的应用级Build.Gradle文件中。

做这个:

defaultConfig {
    applicationId "com.yourcompanyname.yourappname"
    minSdkVersion 21
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

    // Enabling multidex support.
    multiDexEnabled true
}
2 Android:任务“:app:dexDebug”的执行失败

我的Android Studio项目有问题,编译良好,我不知道该怎么做才能破坏它。 错误:任务':app:dexDebug'的执行失败。 com.android.ide.common.internal.LoggedErrorException:无法运行命令:C:\\ Users \\ ...

3 任务执行失败:app:dexDebug

当我运行我的android项目时,出现以下错误: 我尝试了Build- > Clean Project,但是徒劳。我尝试了“用gradle文件同步项目”,但是徒劳。我的build.gradle文件是: 我也将minifyEnabled设置为true,但无法正常工作。请帮助我 ...

4 任务“ app:dexDebug”的执行失败

我最近尝试在我的应用程序上测试本地后端支持,并且遇到了一些gradle构建问题。 以下是我遇到的错误: com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException ...

2015-07-31 18:56:34 1 894   android
5 Android:Facebook SDK任务app.dexDebug的执行失败

我尝试为我的应用程序使用facebook SDK,但它给出了app.dexDebug异常 这是我的gradle文件的片段: 我的文章是红色的,我知道Facebook使用列表中的相同项目,但是在这种情况下,我应该删除哪个项目,这样才不会损害应用程序,并且我还可以使用Facebook ...

7 任务':app:dexDebug'android执行失败

我知道以前曾问过这个问题,但仍然没有得到答案。 代码运行正常,但是当我尝试将其与Firebase集成时,我开始收到此错误。 错误:任务':app:dexDebug'的执行失败。 com.android.ide.common.process.ProcessException:or ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM