Reputation: 543
I got and error with Android studio 2.0 preview 4
Error:(1, 1) A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.android.application'] Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in App/myfolder/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
I have already change the the distributionUrl but still above error is show up, here is my setting on gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
And here is my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.craftedinbali.edy.cdbu"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:21.1.1'
}
EDITED
And here is my project gradle.build
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Any help will be appreciate.
Upvotes: 1
Views: 2148
Reputation: 313
Go to File->Settings... Menu "Build,Execution,Deployment"->"Build Tools"->"Gradle" And Check "Use default gradle wrapper (recommended)"
You can also click CTRL+ALT+S to open the settings menu. If you can't find the gradle section, just seach "gradle" in the search text box situated on the top of the settings window
Upvotes: 3
Reputation: 3074
Right click your project, click "Open Module Settings"
Then Click "Project" and set Gradle version to 2.10
Gradle will now build with Gradle 2.10
Upvotes: 2