When I import projects from github into Android studio I see various errors related to the gradle version. For all the miseries of Eclipse I dont ever remember needing to do an upgrade every time to all sorts of different reasons. Usually it was SDK only.
I see a lot of errors along the lines of:
Error:failed to find Build Tools revision 21.1.0
<a href="install.build.tools">Install Build Tools 21.1.0 and sync project</a>
Failed to apply plugin [id 'com.android.application'] Gradle version 2.1 is required. Current version is 2.2.1. If using the gradlewrapper, try editing the distributionUrl in /Users/Mac1/Downloads/u2020-dagger2 /gradle/wrapper/gradle-wrapper.properties to gradle-2.1-all.zip
It seems odd that a system designed to reduce the complexity of dependencies would demand the installation of old versions of gradle or build tools. Why does this kind of thing happen. Does this mean it has no build tools or just not that version? Does it mean it must be the old version? It certainly seems to be encouraging backward compatibility by insisting in installing old versions of everything. Gradle, build tools etc. I don't mean to be rude, so I'll keep quiet about what I think of this. In the meantime, what are we supposed to do?
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
allprojects {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
}
Here is project level build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 21
buildToolsVersion '21.1.0'
defaultConfig {
applicationId 'dagger.demo'
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName '1.0'
}
}
dependencies {
compile 'com.google.dagger:dagger:2.0-SNAPSHOT'
apt 'com.google.dagger:dagger-compiler:2.0-SNAPSHOT'
provided 'org.glassfish:javax.annotation:10.0-b28'
}