1

I'm trying to build my Android app in Android Studio, but I have got the following error:

Gradle: A problem occurred evaluating project ':libraries:facebook'.
> Gradle version 1.6 is required. Current version is 1.8

How can I fix it? I don't know what is wrong with my build.gradle file:

buildscript {
    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
    }
}

apply plugin: 'android-library'

dependencies {
    compile files('libs/android-support-v4.jar')
}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
}

How can I fix it? Thanks in advance.

malcoauri
  • 11,904
  • 28
  • 82
  • 137

1 Answers1

0

Update Android Studio to last release. Then change:

classpath 'com.android.tools.build:gradle:0.8'

Modify your gradle/wrapper/gradle-wrapper.properties to use the 1.10 version of Gradle.

Also to improve your script, you can change this line

compile files('libs/android-support-v4.jar')

with

compile 'com.android.support:support-v4:18.0.0'  //or 19.0.1

There is a relation between IDE, gradle-plugin and the gradle version.

relation between gradle version and gradle build tool version

Community
  • 1
  • 1
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841