小编Roh*_*ati的帖子

要在进程中运行dex,Gradle守护程序需要更大的堆.它目前有大约910 MB

每次运行我的应用程序时,我都会收到此Gradle错误.错误是:

要在进程中运行dex,Gradle守护程序需要更大的堆.它目前有大约910 MB.

要加快构建速度,请将Gradle守护程序的最大堆大小增加到2048 MB以上.

为此,请在项目gradle.properties中设置org.gradle.jvmargs = -Xmx2048M.有关更多信息,请参阅https://docs.gradle.org/current/userguide/build_environment.html

这是我的build.gradle(Module:app)文件:

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.3"

        defaultConfig {
            applicationId "mobileapp.tech2dsk"
            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.3.0'
        compile 'com.android.support:design:23.3.0'
    }
Run Code Online (Sandbox Code Playgroud)

这是我的build.gradle(Project)文件:

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies …
Run Code Online (Sandbox Code Playgroud)

android android-studio gradle-daemon

74
推荐指数
5
解决办法
5万
查看次数

标签 统计

android ×1

android-studio ×1

gradle-daemon ×1