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

时间:2015-09-01 09:57:26

标签: android gradle build runtime-error

我的build.gradle文件有问题 我得到这样的错误。

     ****

        Error:Execution failed for task ':app:dexDebug'.
            > com.android.ide.common.process.ProcessException: 
        org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' 
    finished with non-zero exit value 2**

**

的build.gradle(模块)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "app_id"
        minSdkVersion 17
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDir 'jniLibs'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '2.2.2'
}

我在我的bulild.gradle中做了很多变化,但是我无法正确使用

这是我的Build.gradle(项目)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.google.gms:google-services:1.3.0-beta1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

我不知道如何避免这个错误帮助我 提前致谢

1 个答案:

答案 0 :(得分:1)

将此添加到您的文件构建中。 gradle这个

 defaultConfig {
 multiDexEnabled true 
  }