3

I have an .aar library (libA.aar) file and a library module. The .aar file added to library module in dependencies section (at library module build.gradle)(libB.aar):

implementation files('libs/libA.aar')

When I export this library as an .aar file (libB.aar) the imported library (libA.aar) not found on exported file.

How can I import that .aar file in a library and having that in exported file? Is need to use offline Maven repository?

I need a fat library with all of dependency inside that as an .aar file.

double-beep
  • 5,031
  • 17
  • 33
  • 41
javadroid
  • 1,421
  • 2
  • 19
  • 43
  • Possible duplicate of [How to manually include external aar package using new Gradle Android Build System](https://stackoverflow.com/questions/16682847/how-to-manually-include-external-aar-package-using-new-gradle-android-build-syst) – alireza daryani Oct 16 '19 at 07:20
  • @alirezadaryani i read that question and is not useful for me, the exported library file with flat dir does not contain aar included. – javadroid Oct 16 '19 at 08:03

3 Answers3

1

You can create fat aar for your library with imported aar. Please go through https://android.jlelse.eu/android-fat-aar-from-gradle-892038facc87

raghu
  • 671
  • 5
  • 16
0

You have to separately include[copy/paste] all the used .aar libraries into the integrating application as well.

Kuldeep Rathee
  • 282
  • 2
  • 7
-1

Add your .aar file in src -> main -> libs folder

Adding .aar file


Add path in your build.gradle(Project) file

allprojects {
    repositories {
        google()
        jcenter()
        flatDir { //Add this code
            dirs 'src/main/libs'
        }
    }
}

Add implementation code in your build.gradle(app) file

dependencies {
    implementation(name: 'nameOfAARFile', ext: 'aar')
}
Shreeya Chhatrala
  • 1,441
  • 18
  • 33