简体   繁体   English

摇篮建立错误

[英]Gradle Building Errors

I've been receiving the following error: 我收到以下错误:

Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 错误:任务':app:dexDebug'的执行失败。> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'command'/Library/Java/JavaVirtualMachines/jdk1.8.0 _60.jdk / Contents / Home / bin / java''完成,返回值非零2

This is my current dependency. 这是我目前的依赖。 I have been trying to figure out how to resolve this error but I just can not figure it out. 我一直在试图找出解决该错误的方法,但我只是无法弄清楚。 Any suggestions or help will be greatly appreciated. 任何建议或帮助将不胜感激。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.vokanovich.myapplication"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile ("com.magnet.mmx:magnet-mmx-client-android:1.9.1@aar") {
    transitive=true
    }
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.android.gms:play-services-base:7.8.0'
    compile 'com.google.android.gms:play-services-gcm:7.8.0'
    compile('com.mikepenz:materialdrawer:4.3.7@aar') {
        transitive = true
    }

    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
}

And this is my other build.gradle 这是我的另一个build.gradle

// 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.3.0'

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


allprojects {
    repositories {
        jcenter()
        mavenLocal()
        maven {
            url "https://repo.magnet.com/artifactory/public"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

The issue was that it exceeded 65k methods. 问题是它超过了65k方法。 It was resolved by applying the following solution: https://stackoverflow.com/a/31759781/1371041 通过应用以下解决方案可以解决此问题: https : //stackoverflow.com/a/31759781/1371041

I had the same problem. 我有同样的问题。 Just write inside defaultConfig in build.gradle defaultConfig { multiDexEnabled true } 只需在build.gradle defaultConfig { multiDexEnabled true }写入 defaultConfig { multiDexEnabled true }

Hope this help you!) 希望对您有帮助!)

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

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