简体   繁体   中英

Gradle build fails in Android Studio

I am using Android Studio and created a new project, which created the standard "Hello world" mock.

My gradle.build file has the following contents:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.whatever.blabla"
        minSdkVersion 19
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

Even though I did not change anything, Gradle still fails when trying to build it with the error:

Failed to complete Gradle execution.

Cause:
A fatal exception has occurred. Program will exit.

First of all, is there any way of getting extra info about the problem? And secondly, why is this happening since I only created a standard project?

I had the same problem and could fix it by following solution provided in the below link - https://code.google.com/p/android/issues/detail?id=67946

Though I am not sure how setting the maxheapsize has fixed the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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