Manually adding aar with dependency pom/iml file

1. Publishing In your aar project, add maven-publish plugin and add necessary plugin configuration. apply plugin: ‘com.android.library’ apply plugin: ‘maven-publish’ … dependencies { testCompile ‘junit:junit:4.12’ compile ‘com.android.support:appcompat-v7:23.1.1’ compile ‘com.novoda:bintray-release:0.2.7’ } … publishing { publications { maven(MavenPublication) { groupId ‘com.example’ //You can either define these here or get them from project conf elsewhere artifactId ‘example’ version … Read more

Gradle finished with non-zero exit value 1 (ic_launcher.png: error: Duplicate file)

According to Xavier Durochet’s explanation on G+, it’s due to one of the libraries you use having it’s own ic_launcher.png — which they of course should not (more on that at the bottom). Chances are the two icons mentioned in the log are different: one is yours and another one is most likely the generic … Read more

Cordova plugin development – adding aar

Here’s what I’ve done to use a gradle reference with a Cordova plugin, I think this might help you. Global structure : pluginFolder/ build-extras.gradle plugin.xml yourDirContainingYourAAR/ src/ android/ yourFile.gradle myPlugin.java Put your library, say foo.aar, in the yourDirContainingYourAAR directory (create it if needed) In the plugin.xml file : <platform name=”android”> <!– your configuration elements, references, … Read more

Adding local .aar files to my gradle build

You put your flatDir block in the wrong repostories block. The repositories block inside buildscript tells Gradle where to find the Android-Gradle plugin, but not the rest of the dependencies. You need to have another top-level repositories block like this: repositories { mavenCentral() flatDir { dirs ‘aars’ } } I tested this and it works … Read more

Android Library Gradle release JAR

While I haven’t tried uploading the artifacts with a deployment to Sonatype (or even a local repo), here’s what I managed to come up with a few weeks ago when trying to tackle the same problem. android.libraryVariants.all { variant -> def name = variant.buildType.name if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { return; // Skip debug builds. } def task … Read more