android - 在Android Studio中获取app:dexDebug错误

标签 android android-studio gradle

这是我在应用程序中使用的完整app.gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc2"
    defaultConfig {
        applicationId "com.me.album"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 4
        versionName
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }

    lintOptions {
        checkReleaseBuilds false
    }

}
dependencies {
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.nineoldandroids:library:2.4.0'
    compile project('libraries:library')
    compile project('libraries:animation_library')
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.android.support:recyclerview-v7:22.2.0'
    compile 'com.pnikosis:materialish-progress:1.5'
    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/crittercism_v5_0_6_sdkonly.jar')
    compile files('libs/httpcore-4.3.3.jar')
    compile files('libs/httpmime-4.3.6.jar')
    compile files('libs/mail.jar')
    compile files('libs/mpandroidchartlibrary-2-1-5.jar')
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile project(':app:libraries:ExpandableLibrary')
    compile project(':app:libraries:library_appintro')
    compile project(':app:libraries:library_circular_loading:library')
    compile 'com.google.android.gms:play-services-maps:6.5.87'
    compile project(path: ':Push Notification', configuration: 'android-endpoints')
}

总是出错
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

最佳答案

在默认配置中添加以下内容:

defaultConfig{
                multiDexEnabled = true
            }

并在同一build.gradle中添加:
dexOptions {
    javaMaxHeapSize "4g"
}

并在依赖项中添加:
 dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.0'
}

这可能会帮助您!

关于android - 在Android Studio中获取app:dexDebug错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33229449/

相关文章:

Android数据绑定(bind)调试

Android自定义对话框线性布局大小与对话框背景图像相同

android - 与 viewPager 共享元素转换

android - Android Studio 0.3.1错误:配置项目时出现问题

android - 从 Eclipse 到 android studio 互联网问题

android - 升级到 Android Studio 北极狐 Beta 4 后无法构建

intellij-idea - 具有2个 Ant 目标的Gradle任务-尝试合并 Ant 目标以加快执行时间

Jenkins Gradle 应用程序 :mergeDebugResources Unable to open PNG file

java - Android Studio mailto Intent 不显示主题和邮件正文

android - 带有 edittext 的 DialogFragment 在解雇后不会丢失键盘