为了在进程中运行 dex,Gradle 守护进程需要更大的堆.它目前有 910 MB [英] To run dex in process, the Gradle daemon needs a larger heap. It currently has 910 MB

查看:21
本文介绍了为了在进程中运行 dex,Gradle 守护进程需要更大的堆.它目前有 910 MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上主要的错误是java.exe 以非零退出值 1 结束".首先我告诉你我在安装 Studio 后遇到的每一个问题:

Actually the main error is "java.exe finished with non-zero exit value 1". First i tell you every problem which i faced after installing studio:

三天前,我刚刚安装了 android studio &我创建了新项目.

Three days ago, i just installed android studio & I created new project.

1) 首先它抛出错误插件太旧,请更新到最新版本",在谷歌搜索后我改变了

1) First it throw the error "Plugin is too old, please update to more recent version", after searching on google i changed

classpath : com.android.tools.build:gradle:2.0.0-alpha2

classpath : com.android.tools.build:gradle:2.0.0-alpha8

当前错误已解决.

2) 之后它要求 gradle 2.10,我也更新了这个 &设置路径.当前错误已解决.

2) After that it was asking for gradle 2.10, i updated this one also & set the path. Current Error solved.

3) 当我运行我的应用程序时,我又遇到了一个错误app-debug-unaligned.apk,为属性'输入文件'不存在指定".

3) When i ran my application i got one more error "app-debug-unaligned.apk, specified for property 'input file' does not exist".

我在互联网上搜索,我在 stackoverflow 上找到了一个解决方案.所以作为对stackoverflow的回答,我去构建"&我选择了build apk.

I searched on internet, i got one solution on stackoverflow. So as answer on stackoverflow i go to "Build" & i selected build apk.

当前错误已解决.

4) 但在那之后我又犯了一个错误

4) But after that again i got one error

"要在进程中运行 dex,Gradle 守护进程需要更大的堆.它目前有 910 MB.要加快构建速度,请将 Gradle 守护程序的最大堆大小增加到 1G 以上.

"To run dex in process, the Gradle daemon needs a larger heap. It currently has 910 MB. For faster builds, increase the maximum heap size for the Gradle daemon to more than 1G.

java.exe 以非零退出值 1" 结束.

java.exe finished with non-zero exit value 1".

过去三天我一直在 stackoverflow 上搜索,我一一应用了每一个答案,但我无法解决错误.请救救我的命,我真的厌倦了这个问题.我向您展示了究竟发生了什么错误

I have been searching on stackoverflow for last three days, i applied each and every answer one by one but i'm not able to solve the error. Please save my life, i am really tired of this problem. I show you image what error is coming exactly

我的build.gradle文件

apply `plugin: com.android.application`

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "java.danish.org.myapplication"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}

我更新了所有 SDK 平台 &SDk 工具.

I updated everything SDK platforms & SDk Tools.

请告诉我我在这里做错了什么.

Please tell me what i am doing wrong here.

推荐答案

我找到了解决方案.

变化1)

 dexOptions {
            javaMaxHeapSize "4g"
        }

2)

 lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }

这是我的新 build.gradle,现在一切正常.

This is my new build.gradle and everything is working fine now.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0 rc4"

    dexOptions {
        javaMaxHeapSize "4g"
    }
    defaultConfig {
        applicationId "com.aquasoft.guesp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile 'com.google.android.gms:play-services:9.0.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.stripe:stripe-android:+'
    compile 'com.roomorama:caldroid:3.0.1'
    compile 'com.android.support:cardview-v7:23.3.+'
}

这篇关于为了在进程中运行 dex,Gradle 守护进程需要更大的堆.它目前有 910 MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆