Trying to create a standard Android project using Gradle which I will import into Eclipse.
Am using the following tools (Eclipse IDE along with plug-ins):
- Eclipse Kepler SR 2 (SE 64 bit)
- Android Development Plug-in 22.6.3.v201404151837-1123206
- Gradle IDE 3.5.1.201404300713-RELEASE
- Groovy Compiler 1.8 - 2.1 Feature (along with dependencies)
Am able to create a standard Gradle project but when I tried to follow the tutorial (to setup an Android / Gradle project) located at:
http://www.vogella.com/tutorials/AndroidBuild/article.html
apply plugin: 'android'
apply plugin: 'eclipse'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4+'
}
}
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
android {
buildToolsVersion "17.0"
compileSdkVersion 17
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
I got the following in my Eclipse's console:
FAILURE: Build failed with an exception.
Where: Build file '/GradleProjects/hello/build.gradle' line: 1
What went wrong: A problem occurred evaluating root project 'hello'.
Could not create plugin of type 'AppPlugin'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Question(s):
(1) Is there a standard way to create an Android Gradle project (which one can add more to the build script later on) using Eclipse (e.g. writing the build script and / or importing into Eclipse as a Gradle project)?
(2) I know I am using the latest versions (both Android and Gradle) but it doesn't work when I try to add
classpath 'com.android.tools.build:gradle:1.10+'
Would really appreciate it if someone can point me to a good reference...