Questions tagged [aar]

AAR (Android Library Archive) is a package file format, similar to APK (Android package) file format, that you can use as a dependency for an Android app module

AAR (Android Library Archive) is the binary distribution of an Android library project. AAR file is variant of file similar to . AAR files can contain Android resources and a manifest file, which allows you to bundle in shared resources like layouts and drawables in addition to Java classes and methods.

AAR file is used to share resources between multiple Android applications or between multiple versions (for example free and paid) of same Android application.

1001 questions
214
votes
10 answers

Create aar file in Android Studio

I'd like to create an aar file for my library in Android Studio, i would've gone with a jar option but my library has resources. Any idea how to create an aar file from a library?
AndroidEnthusiast
  • 6,557
  • 10
  • 42
  • 56
178
votes
15 answers

Adding local .aar files to Gradle build using "flatDirs" is not working

I'm aware of this question: Adding local .aar files to my gradle build but the solution does not work for me. I tried adding this statement to the top level of my build.gradle file: repositories { mavenCentral() flatDir { dirs…
154
votes
5 answers

Android Archive Library (aar) vs standard jar

I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on jar files in order to build my project. However it seems that Android has…
Aritz
  • 30,971
  • 16
  • 136
  • 217
140
votes
22 answers

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

We recently upgraded to Android Gradle Plugin 4.0.0-beta03. We are now seeing this error when building one of our library modules $ ./gradlew library_module:assemble Execution failed for task ':library_module:bundleDebugAar'. > Direct local .aar…
tir38
  • 9,810
  • 10
  • 64
  • 107
103
votes
8 answers

Transitive dependencies not resolved for aar library using gradle

I have investigated a while and probably saw most popular answers here related to aar and transitive dependencies but somehow it is still not clear for me how to make this working. So: I have android library with given gradle config: apply plugin:…
mkorszun
  • 4,461
  • 6
  • 28
  • 43
98
votes
8 answers

How to convert AAR to JAR

Situation: I intend to use a Java library and I only have an AAR file from a Maven repository but I need the JAR file. Background story: I tried to compile a library, but its Gradle structure was unstable. So I asked for a compiled jar file, and…
Nestor
  • 8,194
  • 7
  • 77
  • 156
75
votes
13 answers

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

I got this strange error with gradle, please help me! /.../app/build/intermediates/res/debug/drawable-xxhdpi-v4/ic_launcher.png: error: Duplicate file /.../app/build/intermediates/res/debug/drawable-xxhdpi/ic_launcher.png: Original is here.…
Fayçal
  • 1,150
  • 1
  • 12
  • 19
71
votes
7 answers

Adding local .aar files to my gradle build

So I have created an Android library and successfully compiled it into a .aar file. I called this aar file: "projectx-sdk-1.0.0.aar". Now I want my new project to depend on this aar so what I have done is follow this post. But the post confuses me…
sn0ep
  • 3,843
  • 8
  • 39
  • 63
63
votes
3 answers

Android Library Gradle release JAR

How can I release Jar packaging of android-library project? I've found, classes.jar is located under build/bundles/release/classes.jar and I suppose this is correct Jar package (contains *.class files). Is there some official way, to release library…
Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
51
votes
2 answers

Modifying contents of Android .aar file / Converting to and from .zip format

So I have a .aar file which has a file I need to remove from inside it. I am running on mac and changed the extention from .aar to .zip and unzipped the zip file. I then removed the file from the folder, recompressed it back into a .zip and then…
user1782677
  • 1,963
  • 5
  • 26
  • 48
49
votes
11 answers

Issues were found when checking AAR metadata: androidx.core:core:1.12.0-alpha01 and androidx.core:core-ktx:1.12.0-alpha01

I am working on a project and today the build is not working anymore. The error is the following: 2 issues were found when checking AAR metadata: Dependency 'androidx.core:core:1.12.0-alpha01' requires libraries and applications that depend on it…
Valentin Cerneanu
  • 895
  • 2
  • 8
  • 11
47
votes
2 answers

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…
cs x
  • 621
  • 2
  • 8
  • 23
45
votes
1 answer

Transitive dependencies for local aar library

We're making some library, basicly for our API, that we would make life easier for our external developers. So we created new library project and put Retrofit and some other libraries as dependencies. dependencies { compile…
Pitel
  • 5,334
  • 7
  • 45
  • 72
42
votes
6 answers

how update local aar package sources

I created two Android Studio applications. One of them is aar library. I used this aar library in second application. I added aar library by using File->New->New Module->Import AAR/JAR Packages option. after that I can see decompiled sources of my…
utarid
  • 1,642
  • 4
  • 24
  • 38
42
votes
3 answers

how to start an activity in another module explicitly

I created an aar and i added it to my project as an module. in this module i have a HelloWorldActivity that i want to run. my module manifest looks like this.
Alireza Ahmadi
  • 5,122
  • 7
  • 40
  • 67
1
2 3
66 67