简体   繁体   English

生成错误,Gradle->错误:任务':app:preDexDebug'的执行失败。 > org.gradle.process.internal.ExecException:

[英]Build error ,Gradle -> Error:Execution failed for task ':app:preDexDebug'. > org.gradle.process.internal.ExecException:

I use Android Studio. 我使用Android Studio。

Module App: 模块应用:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion '22.0.1'
    compileOptions {
        encoding "UTF-8"

    }
    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 10
        targetSdkVersion 22
        versionCode 1
        versionName '1'
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile files('libs/volley.jar')
    compile 'com.google.android.gms:play-services:7.5.0'
}

Project com.my.app 项目com.my.app

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

But I get this error: 但是我得到这个错误:

error : Error:Execution failed for task ':app:preDexDebug'.
org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program
Files\Java\jdk1.8.0_45\bin\java.exe''

With gradlew compileDebug --stacktrace : 使用gradlew compileDebug --stacktrace:

* Exception is:
org.gradle.execution.TaskSelectionException: Task 'compileDebug' is ambiguous in
 root project 'BillionsOfPeople'. Candidates are: 'compileDebugAidl', 'compileDe
bugAndroidTestAidl', 'compileDebugAndroidTestJava', 'compileDebugAndroidTestNdk'
, 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestSources', 'comp
ileDebugJava', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSourc
es', 'compileDebugUnitTestJava', 'compileDebugUnitTestSources'.

 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:33)

     at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)

    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)

gradlew compileDebug : gradlew compileDebug:

FAILURE: Build failed with an exception. 失败:构建失败,发生异常。

  • What went wrong: Task 'compileDebug' is ambiguous in root project 'MyApp'. 出了什么问题:根项目“ MyApp”中的任务“ compileDebug”不明确。 Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTest Java', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'com pileDebugAndroidTestSources', 'compileDebugJava', 'compileDebugNdk', 'compileDeb ugRenderscript', 'compileDebugSources', 'compileDebugUnitTestJava', 'compileDebu gUnitTestSources'. 候选对象为:'compileDebugAidl','compileDebugAndroidTestAidl','compileDebugAndroidTest Java','compileDebugAndroidTestNdk','compileDebugAndroidTestRenderscript','comileDebugAndroidTestSources','compileDebugJava','compileDebugNdk','compileDeb ugRenderSource',' 'compileDebu gUnitTestSources'。

NOTE: I cannot run sdk manager. 注意:我无法运行sdk管理器。

I think the problem is the value of your applicationId in the build.gradle . 我认为问题在于build.gradle applicationId的值。 It should contain the fully qualified package name of your application because it will be the identifier used by the system to install your app. 它应包含您的应用程序的标准软件包名称,因为它将是系统用于安装您的应用程序的标识符。 "/**/" looks like a really conflicting name for the dex packaging. “ / ** /”看起来像是dex包装的真正冲突的名称。

暂无
暂无

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

相关问题 错误:任务“:app:dexDebug”的执行失败,org.gradle.process.internal.ExecException - Error:Execution failed for task ':app:dexDebug',org.gradle.process.internal.ExecException 任务':app:dexDebug'的执行失败。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException - Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException Android Studio错误:org.gradle.process.internal.ExecException - Android Studio Error: org.gradle.process.internal.ExecException 引起:org.gradle.process.internal.ExecException:Proceorg.gradle.api.tasks.TaskExecutionException:任务':service:bootRun'执行失败 - Caused by: org.gradle.process.internal.ExecException: Proceorg.gradle.api.tasks.TaskExecutionException: Execution failed for task ':service:bootRun' 任务':hVFhirApp:dexDebug'的执行失败。 > com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException: - Execution failed for task ':hVFhirApp:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: 错误:Gradle:任务执行失败':app:preDexDebug' - Error: Gradle: execution failed for task ':app:preDexDebug' AndroidStudio:任务'app的Gradle构建失败:preDexDebug(ProcessException,ExecException,非零退出值1) - AndroidStudio: Gradle build failed for task 'app:preDexDebug (ProcessException, ExecException, non-zero exit value 1) org.gradle.process.internal.ExecException:进程'命令以非零退出值1结束 - org.gradle.process.internal.ExecException: Process 'command finished with non-zero exit value 1 即使使用multiDexEnabled,Android Studio org.gradle.process.internal.ExecException - Android Studio org.gradle.process.internal.ExecException even using multiDexEnabled 模块依赖性导致错误:Gradle:Android Studio中任务':app:preDexDebug'的执行失败 - Module dependency leads to Error:Gradle: Execution failed for task ':app:preDexDebug' in Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM