I would like to use gradle for my Android/Eclipse project because I want to be able to install a development version of my app next to the released version (as seen here: What is a practical way to install stable and development app versions simultaneously?)
Using the command line for doing so is OK for me.
So I moved the src folder of my project to src/main/java and created a build.gradle
file (as described here: http://www.nodeclipse.org/projects/gradle/android/Make-Android-Eclipse-project-ready-for-Android-Studio):
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest.setRoot('tests')
}
}
But when I run gradle build
, I get this error:
FAILURE: Build failed with an exception.
...
> Could not create plugin of type 'AppPlugin'.
I already found that error on stackoverflow. Some people say it's because of using the wrong version of gradle. (Gradle is issuing an error "Could not create plugin of type 'AppPlugin'")
My questions:
- As far as I understand, this version number in build.gradle (0.12.+) is the version of the gradle plugin and not of gradle itself. How can I find out which gradle plugin version I'm using?
- And where does this plugin come from? Is it part of the gradle installation? Or part part of Eclipse? Or of ADT?
- I installed Gradle IDE as Eclipse plugin. Does it interfere with a regular gradle installation?