Android Question

To run dex in process, the Gradle daemon needs a larger heap. It currently has 910 MB

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:

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

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


to

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


Current Error solved.

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

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

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

Current error solved.

4) But after that again i got one error

"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
finished with non-zero exit value 1".

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 exactlyenter image description here

My
build.gradle
file

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'
}


I updated everything SDK platforms & SDk Tools.enter image description here

enter image description here

Please tell me what i am doing wrong here.

Answer

I found the solution.

Changes 1)

 dexOptions {
            javaMaxHeapSize "4g"
        }

2)

 lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }

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.+'
}