Reputation: 4639
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 {
}
}
Upvotes: 6
Views: 19956
Reputation: 1439
Seems like these answers are very old, here is figured out the way to to fix the problem,
From AndriodStudio, Step1: Cntrl+Alt+Shift => "S", will open a "Project Structure" window, -or- File > Project Structure Step2: choose "Project" from the left array. Step3: Change the gradlew version here.
Upvotes: 0
Reputation: 579
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'
}
}
Upvotes: 3
Reputation: 11316
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'
Upvotes: 4
Reputation: 22173
You have to update your classpath. Currently I've got:
classpath 'com.android.tools.build:gradle:1.0.0-rc4'
Edit:
Replace runProguard with minifyEnabled in your gradle build file
Upvotes: 2