3

I want to know how to create fat AAR file in android studio.

For example I have project A as an Android library (.AAR) , which is dependent on 2 local modules projects M1 and M2 (included as

dependencies { 
compile project (m1) ...."

in build.gradle of library project A).

My questions are,

Q1. When I'm generating the .aar file of library A then how to include m1 and m2 inside the .aar file?

Q2. How to tell project B (android application which is including A.aar as dependency) to compile JCenter dependencies being used by m1 and m2?

Piyush Dhomne
  • 41
  • 1
  • 4
  • See this question for an answer: https://stackoverflow.com/questions/28605367/library-with-bundles-dependencies-fat-aar – Display name Nov 07 '17 at 05:54

2 Answers2

0

I think you can solve this by using maven repositories and adding m1 and m2 as dependency in *.pom file `

<dependencies>
   <dependency>
       <groupId>com.android.databinding</groupId>
       <artifactId>baseLibrary</artifactId>
       <version>3.3.0</version>
       <scope>compile</scope>
   </dependency>
   <dependency>
       <groupId>com.android.databinding</groupId>
       <artifactId>library</artifactId>
       <version>3.3.0</version>
       <scope>compile</scope>
   </dependency>
</dependencies>

`

more about maven dependencies in https://maven.apache.org/pom.html

Murugappan Vr
  • 175
  • 1
  • 6
0

Android Gradle plugin does not officially support this. But you can use a plugin like this. https://github.com/Mobbeel/fataar-gradle-plugin

Asanka sanjaya
  • 1,461
  • 3
  • 17
  • 35