Gradle generating incorrect POM subproject info - android

I have an Android project using Gradle 2.2, it has 2 sub projects and one is dependent on the other. I am using Maven plugin to deploy to Artifactory and it isn't generating the correct POM.
-project
-subproject1
-subproject2 (depends on subproject1)
subproject1/build.gradle, generates a JAR:
apply plugin: 'java'
apply plugin: 'maven'
def version = '1.0.0-SNAPSHOT'
def artifactId = 'subproject1'
def groupId = 'com.xxx.yyy'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'junit:junit:4.11'
compile 'org.slf4j:slf4j-api:1.7.7'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'https://my-artifactory-repo' ) {
authentication(userName: ..., password: ...)
}
snapshotRepository(url: 'https://my-artifactory-repo' ) {
authentication(userName: ..., password: ...)
}
pom.version = version
pom.artifactId = artifactId
pom.groupId = groupId
}
}
}
task installArchives(type: Upload) {
configuration = configurations['archives']
repositories {
mavenDeployer {
repository url: 'my-local-repo-path'
pom.version = version
pom.artifactId = artifactId
pom.groupId = groupId
}
}
}
The subproject1 POM is generated correctly.
subproject2/build.gradle, generates an AAR:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.slf4j:slf4j-api:1.7.7'
compile project(':subproject1')
}
The subproject2 POM is not generated correctly, for subproject1, the groupid has the same value as artifactId and version is unspecified. Anyone know how to fix this?

Related

External dependency not included after deploy to artifactory

I develop small mvp library with included some dependency like butterknife and glide, but after it is already deployed to my private artifactory, all the dependency is not included with my library, so all the dependency is not resolved in my project when using this library. I am new with this artifactory, is I am missing something?
This is my root build.gradle :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.1"
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And this is my build.gradle module :
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
apply plugin: 'me.tatarka.retrolambda'
def libraryGroupId = 'com.pixilapps.pixilframework'
def libraryArtifactId = 'mvp'
def libraryVersion = '1.0.0'
publishing {
publications {
aar(MavenPublication) {
groupId libraryGroupId
version libraryVersion
artifactId libraryArtifactId
artifact("$buildDir/outputs/aar/${artifactId}-release.aar")
}
}
}
artifactory {
contextUrl = 'http://my.lib.web/artifactory'
publish {
repository {
repoKey = 'libs-release-local'
username = artifactory_username
password = artifactory_password
}
defaults {
publications('aar')
publishArtifacts = true
properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core']
publishPom = true
}
}
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.3.1'
}
}
repositories {
mavenCentral()
jcenter()
maven { url "https://clojars.org/repo/" }
maven { url "https://jitpack.io" }
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8.toString()
targetCompatibility JavaVersion.VERSION_1_8.toString()
}
}
dependencies {
final PLAY_SERVICES_VERSION = '9.6.1'
final DEXMAKER_VERSION = '1.4'
final HAMCREST_VERSION = '1.3'
final ESPRESSO_VERSION = '2.2.1'
final RUNNER_VERSION = '0.4'
final AUTO_VALUE_VERSION = '1.3'
final AUTO_VALUE_GSON_VERSION = '0.4.2'
final SUPPORT_LIBRARY_VERSION = '25.1.0'
final RETROFIT_VERSION = '2.1.0'
final BUTTERKNIFE_VERSION = '7.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.jakewharton.timber:timber:4.1.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.vistrav:ask:2.4'
compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
compile 'net.danlew:android.joda:2.9.3.1'
compile 'com.pixplicity.easyprefs:library:1.7'
}
You can use pom.withXml in your publishing block, as described here (find the official documentation about pom.withXml here).
It will look like something approaching this, I guess:
publishing {
publications {
aar(MavenPublication) {
groupId libraryGroupId
version = libraryVersion
artifactId libraryArtifactId
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
pom.withXml {
def dependencies = asNode().appendNode('dependencies')
configurations.getByName("_releaseCompile").getResolvedConfiguration().getFirstLevelModuleDependencies().each {
def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', it.moduleGroup)
dependency.appendNode('artifactId', it.moduleName)
dependency.appendNode('version', it.moduleVersion)
}
}
}
}
}

Android Studio update - Failed to resolve com.android.databinding

I recently updated my JAVA to 1.8 version and also made android studio updates and gradle plugin updates as well. After the update i get following error in one of my module's(i.e. facebook module) build.gradle file on compiling my project:
My project level build.gradle looks like this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-beta4'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
}
}
allprojects {
repositories {
jcenter()
}
}
Also there are few Symbol not found error like Cannot resolve Symbol 'GradleScriptException' and Cannot resolve symbol 'MavenDeployment' in facebook module build.gradle file. The full code of facebook buil.gradle is:
apply plugin: 'com.android.library'
repositories {
mavenCentral()
}
project.group = 'com.facebook.android'
dependencies {
// Facbook Dependancies
testCompile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.parse.bolts:bolts-android:1.2.1'
// Unit Tests
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.robolectric:shadows-support-v4:3.0'
def powerMockVersion = '1.6.1'
testCompile "org.powermock:powermock-module-junit4:$powerMockVersion" testCompile "org.powermock:powermock-module-junit4-rule:$powerMockVersion" testCompile "org.powermock:powermock-classloading-xstream:$powerMockVersion" androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
testCompile "org.powermock:powermock-api-mockito:$powerMockVersion" androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
// Connected Tests
androidTestCompile 'org.mockito:mockito-core:1.10.19'
}
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
multiDexEnabled true
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dataBinding {
enabled = true
}
}
apply plugin: 'maven'
apply plugin: 'signing'
def isSnapshot = version.endsWith('-SNAPSHOT')
def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
task setVersion {
// The version will be derived from source
project.version = null
def sdkVersionFile = file('src/main/java/com/facebook/FacebookSdkVersion.java')
sdkVersionFile.eachLine{
def matcher = (it =~ /(?:.*BUILD = \")(.*)(?:\".*)/)
if (matcher.matches()) {
project.version = matcher[0][1]
return
}
}
if (project.version.is('unspecified')) {
throw new GradleScriptException('Version could not be found.', null)
}
}
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Facebook-Android-SDK'
artifactId = 'facebook-android-sdk'
packaging 'aar'
description 'Facebook Android SDK'
url 'https://github.com/facebook/facebook-android-sdk'
scm {
connection 'scm:git#github.com:facebook/facebook-android-sdk.git'
developerConnection 'scm:git#github.com:facebook/facebook-android-sdk.git'
url 'https://github.com/facebook/facebook-android-sdk'
}
licenses {
license {
name 'Facebook Platform License'
url 'https://github.com/facebook/facebook-android-sdk/blob/master/LICENSE.txt'
distribution 'repo'
}
}
developers {
developer {
id 'facebook'
name 'Facebook'
}
}
}
}
}
uploadArchives.dependsOn(setVersion)
signing {
required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
// JDK 1.8 is more strict then 1.7. Have JDK 1.8 behave like 1.7 for javadoc generation
if (org.gradle.internal.jvm.Jvm.current().getJavaVersion() == JavaVersion.VERSION_1_8) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
afterEvaluate {
androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}
Clicking on Upgrade plugin and sync project does not do anything.
I have tried "Invalidate cache and restart" as suggested by various sources but it didn't work. I already have mentioned the latest version of gradle plugin in my project build.gradle.
I have gone through Gradle DSL Method not found: testCompile() but it does not resolve my issue.
What should i do to remove this compile error?
TIA
EDIT 1:
I made the change as suggested by sm4, And this DSL method not found error went off but now it fails to compile with the following error:
def powerMockVersion = '1.6.1'
testCompile "org.powermock:powermock-module-junit4:$powerMockVersion" testCompile "org.powermock:powermock-module-junit4-rule:$powerMockVersion" testCompile "org.powermock:powermock-classloading-xstream:$powerMockVersion" androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
testCompile "org.powermock:powermock-api-mockito:$powerMockVersion" androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
// Connected Tests
androidTestCompile 'org.mockito:mockito-core:1.10.19'
The testCompile is actually a call to a method. Because you have multiple testCompile on one line, it is being treated as a call to a method with many parameters. Such method does not exist.
Keep only one definition per line and it should work:
testCompile "org.powermock:powermock-module-junit4:$powerMockVersion"
testCompile "org.powermock:powermock-module-junit4-rule:$powerMockVersion"
testCompile "org.powermock:powermock-classloading-xstream:$powerMockVersion"
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
testCompile "org.powermock:powermock-api-mockito:$powerMockVersion"
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
After trying the fix mentioned by #sm4 i resolved the initial issue that i mentioned but it created another issue written in EDIT 1 section of question.
I followed this answer and then finally my project got compiled without any error.

Gradle DSL method not found: 'compile()' while using tesseract library

I have tried to import tesseract ocr project in android studio. While building gradle it showin error as following
Error:(8, 0) Gradle DSL method not found: 'compile()'
Possible causes:The project 'textfairy' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
My app/build.gradle file
import java.util.regex.Pattern
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
import org.apache.tools.ant.taskdefs.condition.Os
task ndkBuild(type: Exec,description: 'run ndk-build') {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
workingDir 'src/main/jni'
commandLine 'ndk-build.cmd', '-j', Runtime.runtime.availableProcessors()
} else {
workingDir 'src/main/jni'
commandLine "$ndkDir/ndk-build", '-j', Runtime.runtime.availableProcessors()
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(ndkBuild)
}
def getVersionCodeFromManifest(String prefix) {
def manifestFile = file("src/main/AndroidManifest.xml")
def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
def manifestText = manifestFile.getText()
def matcher = pattern.matcher(manifestText)
matcher.find()
def version = prefix + matcher.group(1)
println sprintf("Returning version %s", version)
return Integer.parseInt("$version")
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
testInstrumentationRunner "android.test.InstrumentationTestRunner"
//testHandleProfiling true
//testFunctionalTest true
}
signingConfigs {
release
}
buildTypes {
debug {
debuggable true
}
release {
//runProguard true
proguardFile file('android.pro')
proguardFile getDefaultProguardFile('proguard-android.txt')
signingConfig signingConfigs.release
}
}
productFlavors {
x86 {
versionCode getVersionCodeFromManifest("6")
ndk {
abiFilter "x86"
}
}
aV7 {
versionCode getVersionCodeFromManifest("2")
ndk {
abiFilter "armeabi-v7a"
}
}
aV5 {
versionCode getVersionCodeFromManifest("1")
ndk {
abiFilter "armeabi"
}
}
}
sourceSets {
main {
//jniLibs.srcDirs = ['native-libs']
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] //disable automatic ndk-build
}
}
}
def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
compile fileTree(dir: 'src/main/libs', include: '*.jar')
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile 'com.github.chrisbanes.photoview:library:1.2.2'
compile 'com.google.code.findbugs:jsr305:2.0.2'
compile "com.google.guava:guava:18.0"
compile 'de.greenrobot:eventbus:2.4.0'
//compile 'com.android.support:design:22.2.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.android.support:appcompat-v7:19.0.+'
compile 'org.apache.commons:commons-compress:1.5'
compile project(":tess-two:tess-two")
compile 'com.android.support:cardview-v7:21.0.+'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
androidTestCompile 'com.google.dexmaker:dexmaker:1.0'
androidTestCompile 'org.mockito:mockito-core:1.10.17'
androidTestCompile 'junit:junit:4.12'
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-all:1.10.19"
testCompile("org.robolectric:robolectric:3.0-rc2") {
exclude group: 'commons-logging', module: 'commons-logging'
}
compile('com.crashlytics.sdk.android:crashlytics:2.4.0#aar') {
transitive = true;
}
}
My project root build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
}
allprojects {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
maven {
url "http://oss.sonatype.org/content/repositories/snapshots"
}
}
}
dependencies {
apply plugin: 'osgi'
compile project(':libraries:tess-two')
}
My settings.gradle file
include ':libraries:tess-two'
include ':app'
My gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
I have added dependencies also. Please tell me what is the problem.
Thank you
You have to change your top-level build.gradle, removing the compile line, and adding the gradle and fabric plugin.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
maven {
url "http://oss.sonatype.org/content/repositories/snapshots"
}
}
}
Als if you want to use the libraries:tess-two in your project, you have to add this line inside the dependecies block of your app/build.gradle file
compile project(':libraries:tess-two')
Finally move the apply plugin: 'osgi' at the beginning of the app/build.gradle file
To resolve the ndk issue you have to:
add gradle.properties file to root folder of your project
add 'android.useDeprecatedNdk=true' to gradle.properties file
Here is my gradle.properties :
android.useDeprecatedNdk=true

How to use local aar dependency?

i google about local aar,every one say it can work,but it don't work at android studio 1.1.0.
i try to use :
compile fileTree(dir: 'libs', include: ['*.aar'])
but it tip:
Warning:Project app: Only Jar-type local dependencies are supported. Cannot handle: /Users/kycq/AndroidStudioProjects/QingTaJiao/app/libs/KycqBasic-release.aar
how should i do to use local aar?
if i should use:
compile 'com.example.library:library:1.0.0#aar'
how to do this?
I was getting the same errors.
This was the only thing that helped me:
dependencies {
compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
}
repositories{
flatDir{
dirs 'libs'
}
}
Reference: Adding local .aar files to Gradle build using "flatDirs" is not working
In my case a have to distribute an aar. When i import the aar in another project this error appears.
I solve this problem distributing the aar with a maven dependency structure (pom, md5, etc...)
publishing {
publications {
maven(MavenPublication) {
groupId "<GROUP_ID>"
artifactId "<ARTIFACT_ID>"
version <VERSION>
artifact "$buildDir/outputs/aar/<AAR_FILE>"
pom.withXml {
def dependenciesNode = asNode().appendNode("dependencies")
configurations.compile.allDependencies.each { dependency ->
def dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", dependency.group)
dependencyNode.appendNode("artifactId", dependency.name)
dependencyNode.appendNode("version", dependency.version)
}
}
}
}
repositories {
maven {
url "$buildDir/repo"
}
}
}
On the android application i need to add the local maven repository:
allprojects {
repositories {
jcenter()
maven {
url "<LOCAL_REPO>"
}
}
}
And add the dependency:
compile("<GROUP_ID>:<ARTIFACT_ID>:<VERSION>#aar") {
transitive = true
}

Adapt AndroidAnnotations Maven settings to Gradle

Is it possible to adapt AndroidAnnotations Maven setup into Gradle?
http://code.google.com/p/androidannotations/wiki/MavenEclipse
I can't seem to make it work I keep getting com.sun.codemodel#codemodel;2.5-FROZEN-AA: not found
So far I have this
description = "App"
abbreviation = "App"
version = '1.0.0.BUILD-SNAPSHOT'
buildscript {
repositories {
mavenRepo name: 'gradle-android-plugin', urls: 'http://jvoegele.com/maven2/'
mavenRepo name: 'androidannotations', urls: 'http://repository.excilys.com/content/repositories/releases/'
}
def gradleAndroidPluginVersion = '1.0.0'
dependencies {
classpath "com.jvoegele.gradle.plugins:android-plugin:$gradleAndroidPluginVersion"
}
}
apply plugin: 'android'
apply plugin: 'eclipse'
apply plugin: 'idea'
def compatibilityVersion = 1.6
sourceCompatability = compatibilityVersion
targetCompatibility = compatibilityVersion
repositories {
mavenCentral()
mavenRepo urls: 'http://maven.springframework.org/snapshot'
mavenRepo urls: 'http://maven.springframework.org/milestone'
}
def roboguiceVersion = '1.1.1'
def guiceVersion = '2.0-no_aop'
def springAndroidVersion = '1.0.0.M4'
def commonsHttpClientVersion = '3.1'
def jacksonMapperVersion = '1.8.5'
def androidAnnotationsVersion = '2.1'
dependencies {
compile "org.roboguice:roboguice:$roboguiceVersion"
compile "com.google.inject:guice:$guiceVersion"
compile "org.springframework.android:spring-android-rest-template:$springAndroidVersion"
compile "commons-httpclient:commons-httpclient:$commonsHttpClientVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonMapperVersion"
compile "com.googlecode.androidannotations:androidannotations:$androidAnnotationsVersion"
compile group: 'com.googlecode.androidannotations', name: 'androidannotations', version: '2.1', classifier: 'api'
runtime files('lib/server-standalone.jar')
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
clean {
delete 'gen'
}
idea {
module {
downloadJavadoc = true
}
project {
javaVersion = 'Android 2.2 Platform'
}
}
androidProcessResources.dependsOn(clean)
eclipse.dependsOn(cleanEclipse)
idea.dependsOn(cleanIdea)
defaultTasks 'assemble'
As a first pointer, I can't see the declaration of the maven repository that hosts the androidannotations lib.
you should add http://repository.excilys.com/content/repositories/releases as a maven Repo:
...
repositories {
mavenCentral()
mavenRepo urls: 'http://maven.springframework.org/snapshot'
mavenRepo urls: 'http://maven.springframework.org/milestone'
mavenRepo urls: 'http://repository.excilys.com/content/repositories/releases'
}
...
regards
Okay I managed to solve it
I had to add
repositories {
mavenCentral()
mavenRepo urls: 'http://maven.springframework.org/snapshot'
mavenRepo urls: 'http://maven.springframework.org/milestone'
mavenRepo urls: 'http://repository.excilys.com/content/repositories/releases'
mavenRepo urls: 'http://repository.excilys.com/content/repositories/thirdparty'
}
springAndroidVersion = '1.0.0.M4'
commonsHttpClientVersion = '3.1'
jacksonVersion = '1.8.5'
androidAnnotationsVersion = '2.1.1'
dependencies {
compile "org.springframework.android:spring-android-rest-template:$springAndroidVersion"
compile "commons-httpclient:commons-httpclient:$commonsHttpClientVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile "com.googlecode.androidannotations:androidannotations:$androidAnnotationsVersion"
compile "com.googlecode.androidannotations:androidannotations:$androidAnnotationsVersion:api"
}

Categories

Resources