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

Use an aar library cause missing dependencies using api in Gradle 4.x

I was able to solve it. The main issue was Android O with Gradle 4.x using api dependencies { api ‘com.squareup.okhttp3:logging-interceptor:3.4.1’ api “io.reactivex.rxjava2:rxandroid:$versions.libs.rxAndroid” Most answers are concerning something like this publishing { publications { mipartner(MavenPublication) { groupId ‘…’ artifactId ‘..’ version 1.0 artifact “$buildDir/outputs/aar/myLib-release.aar” //generate pom nodes for dependencies pom.withXml { def dependenciesNode = asNode().appendNode(‘dependencies’) … Read more

aar support in Android.mk

You should add following blocks into your Android.mk LOCAL_STATIC_JAVA_AAR_LIBRARIES:= <aar alias> . . . include $(BUILD_PACKAGE) include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := <aar alias>:libs/<lib file>.aar include $(BUILD_MULTI_PREBUILT) Please also be aware of satisfy minSdkVersion required by library into your manifest file.

Create an AAR with multiple AARs/JARs

I haven’t seen a definitive response that enables me to create an AAR that includes 1 or more AARs or JARs. Yes, I think because this topic is not limited to AAR or JAR, but how Maven manage dependency. https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html while I was able to generate one AAR file that I can use in my … Read more

Error building Android library: Direct local .aar file dependencies are not supported

I recently encountered the same issue, the fix was to remove the library from libs/ and import it using File -> New -> New Module -> Import .JAR/.AAR Package, then referencing it in the library module build.gradle file: dependencies { implementation project(“:imported_aar_module”) } If you are on a newer Android Studio version (4.0.0+), this option … 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