Hello,
I have just tried using gradle android plugin for first time now and I have already encountered some issues. After creating a project with android command line tool:
android create project --target "android-19" --path ./android_project1 --activity MainActivity --package pl.wroc.pwr.patryk
I have tried to use a simple build.gradle file as
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-android-plugin:1.2.1'
}
}
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), \
'proguard-rules.txt'
}
}
}
repositories {
mavenCentral()
}
version = "0.0.1"
androidSignAndAlign {
keyStore = "~/programming/android/workspace_project/mykeystore.keystore"
keyAlias = "project-key"
keyStorePassword = "keystorepass"
keyAliasPassword = "keypass"
}
// Configure the filtering of resources with properties from the Gradle's project scope (2)
processResources {
expand (project.properties)
}
// Configure a dedicated debug build (3)
task configureDebug << {
jar.classifier = "debug"
}
// Configure a dedicated release build (4)
task configureRelease << {
proguard.enabled = true
}
Now after launching any gradle command like e.g. gradle assemble I get this :
sdkDir = /home/USER/programming/tools/adt-bundle-linux-x86_64-20140321/sdk
toolsDir = /home/USER/programming/tools/adt-bundle-linux-x86_64-20140321/sdk/tools
platformToolsDir = /home/USER/programming/tools/adt-bundle-linux-x86_64-20140321/sdk/platform-tools
[ant:taskdef] Could not load definitions from resource anttasks.properties. It could not be found.
FAILURE: Build failed with an exception.
* Where:
Build file '/home/USER/programming/android/workspace_project/android_project1/build.gradle' line: 12
* What went wrong:
A problem occurred evaluating root project 'android_project1'.
> Problem: failed to create task or type gettype
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.102 secs
my project dir contents :
AndroidManifest.xml ant.properties bin build.gradle build.xml libs local.properties proguard-project.txt project.properties res src
any solutions to this ?