Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:The project is using an unsupported version of the Android Gradle plug-in (0.12.2)

Tags:

android

gradle

After update Android Studio I cant run my app - I get this Exception:

Error:The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.0.0-rc4.

This is my buld.gradle dependencies

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
    classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}

UPDATE I changed in build.gradle and now I get this error:

Error:(42, 0) Gradle DSL method not found: 'runProguard()'
Possible causes: The project 'drivernotes-android' may be using a version of Gradle that does not contain the method.
Gradle settings The build file may be missing a Gradle plugin.
Apply Gradle plugin

UPDATE 2 This is my build.gradle (fragment):

buildscript {
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
    maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0-rc4'
    classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'android'
apply plugin: 'crashlytics'

repositories {
maven { url 'http://download.crashlytics.com/maven' }
}


android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
    minSdkVersion 9
    targetSdkVersion 19
}

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}



buildTypes {
    release {
        minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
signingConfigs {
}

}

like image 455
Artem Avatar asked Dec 08 '14 08:12

Artem


2 Answers

Use this version of gradle plugin

classpath 'com.android.tools.build:gradle:1.0.0-rc4'

For more info related to gradle plugin and android studio compatiblity refer this

Edit

As of now both android studio as well as gradle plugin are both stable hence use this

classpath 'com.android.tools.build:gradle:1.0.0'
like image 185
williamj949 Avatar answered Sep 19 '22 10:09

williamj949


In App build.gradle in buildTypes{} i think you using runproguard. runProguard is depreceated so use minifyEnabled instead of runproguard

Edited :

buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

update answer

buildTypes {    
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
like image 33
Lingeshwaran Avatar answered Sep 19 '22 10:09

Lingeshwaran