Error: the project uses an unsupported version of the Android Gradle plugin (0.12.2)

After updating Android Studio, I cannot start my application - 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. 

These are my dependencies buld.gradle

 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 (snippet):

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

}

+6
source share
4 answers

You must update your classpath. I currently have:

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

Edit:

Replace runProguard with minifyEnabled in gradle build file

+2
source

Use this version of the gradle plugin

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

For more information regarding gradle plugin and Android compatibility, refer to this

Edit

Both android studios as well as the gradle plugin are currently stable, so use this

 classpath 'com.android.tools.build:gradle:1.0.0' 
+4
source

In the build.gradle application in buildTypes {}, I think you are using runproguard. runProguard depreceated , so use minifyEnabled instead of runproguard

Edited by:

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

report replies

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

It seems that these answers are very old, so figured out a way to solve the problem,

In AndriodStudio Step1: Cntrl + Alt + Shift => "S" will open the "Project Structure" window, or File-> Project Structure Step 2: select "Project" from the left array. Step 3: Change the version of Gradlew here.

enter image description here

0
source

Source: https://habr.com/ru/post/979262/


All Articles