I had been trying to build my test project jar file using gradle instead of ant with uiautomator android but I am getting BUILD FAILED error.
I had referred using gradle with uiautomator android form here - http://wiliamsouza.github.io/#/2013/10/30/android-uiautomator-gradle-build-system
I had used the following commands :
android create uitest-project -n ProjectName -t 46 -p D:\Android_Workspace\Smriti\ProjectName
set ANDROID_HOME=D:\Android Development\android-sdk
cd D:\Android_Workspace\Smriti\ProjectName
gradle build //here I get build failed error
My gradle-properties is as shown below :
androidSdkHome = D:/Android Development/android-sdk
androidSdkTarget = android-19
androidSdkBuildToolsDir = build-tools/19.0.0
and build.gradle is -
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.5
targetCompatibility = 1.5
version = '0.1'
project.ext {
dexDir = new File('build/dex')
distDir = new File('./dist')
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: androidSdkHome + '/platforms/' + androidSdkTarget, include: '*.jar')
compile group: 'junit', name: 'junit', version: '4.11'
}
jar {
doLast {
tasks.dex.execute()
}
}
task dex(dependsOn: jar, type:Exec) {
println 'Building dex...'
project.dexDir.mkdirs()
workingDir '.'
commandLine androidSdkHome + '/' + androidSdkBuildToolsDir + '/' + 'dx', '--dex', '-- no-strict', '--output=' + buildDir +'/dex/' + project.name + '.jar', jar.archivePath
doLast {
tasks.dist.execute()
}
}
task dist(dependsOn:dex, type:Copy) {
project.distDir.mkdirs()
from(project.dexDir)
into(project.distDir)
include('*.jar')
}
Any help would be appreciated.
Thanks.