I have recently updated my android studio from 1.5 to 2.0 and Iam unable to compile the existing project. When i build the project from the terminal i get the following error.
gradle build --stacktrace
alle@alle-Inspiron-3537:~/AndroidStudioProjects/NewsLetter$ gradle build --stacktrace Note: in order to honour the org.gradle.jvmargs and/or org.gradle.java.home values specified for this build, it is necessary to fork a new JVM. To avoid the slowdown associated with this extra process, you might want to consider running Gradle with the daemon enabled. Please see the user guide chapter on the daemon at http://gradle.org/docs/1.4/userguide/gradle_daemon.html.
FAILURE: Build failed with an exception.
Where: Build file '/home/alle/AndroidStudioProjects/NewsLetter/build.gradle' line: 5
What went wrong: A problem occurred evaluating root project 'NewsLetter'.
Could not find method jcenter() for arguments [] on repository container.
Try: Run with --info or --debug option to get more log output.
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.+'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "design.iith.newsletter"
minSdkVersion 16
targetSdkVersion 23
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 files('libs/volley.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
}
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