Android Gradle Problem

I know that there are 100 questions / answers in this thread, but none of them seem to give me an answer. I know that some (if not all) of my problems are related to my lack of understanding of gradle as a whole. BUT, I hope for help.

I have my project that works fine on my desktop. I am going this week and wanted to work on this on my laptop. I have all the files and they have the same version of Android Studio on both machines. When I opened my project, I kept getting all kinds of gradle errors. I think that at this moment I went for some wild geese.

So, I decided to step back and just create a new empty project in Studio. It ALSO has all kinds of gradle issues. I tried to remove Android Studio and re-insatlling, and there are still no dice even getting the base project, so as not to give gradle errors.

I get

11:12:27 PM gradle Failed to update MyApplication project: Fatal exception occurred. The program will be closed. : gradle settings

Like a mistake.

Below are two of my gradle files.

Top-level file (which was empty in my actual project, but it has something in it by default)

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

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

Next build file

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support:support-v4:18.0.0'
}

I am using Android Studio 0.4.2

, . , , Studio , Android. gradlew.bat, , "apply plugin: android". , .

, , . , , , .

+3
3

IntelliJ IDEA ( Android Studio) : https://code.google.com/p/android/issues/detail?id=65219

→ → → Java →

-Xms256m -Xmx512m

→ → → Gradle →

-XX: MaxHeapSize = 256 -Xmx256m

YourAppName/build.gradle Gradle

classpath 'com.android.tools.build: gradle:0.9. +'

Android Studio, . , "" → " "

+7

"Gradle XXXX, "

.

→ → → Gradle → :

-Xmx256m

, .

.

, - . : , , 32- . .

, RAM, .

, :

fooobar.com/questions/39087/...

+3

, buildToolsVersion 19.0.1, compileSdkVersion 19 , , , .

You can go to Tools -> Android -> SDK Manager and see if you need to install any version specified in the gradle script. Or update the gradle script according to the SDK and build tools you have.

My problem was resolved by updating the SDK and tools!

0
source

All Articles