1

I have .aar(MyLib.aar) file and i want to create a new android library (MyNewLib.aar) which is dependent on MyLib.aar

apply plugin: 'com.android.library'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories{
    flatDir{
        dirs 'libs'
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile(name:'mylib', ext:'aar')

}

When the build is completed the classes that are references to MyLib.aar, are not in the newly created MyNewLib.aar

i have checked this one

How to add .aar dependency in library module?

it doesn't work

Community
  • 1
  • 1
Lakhwinder Singh
  • 6,799
  • 4
  • 25
  • 42

1 Answers1

0

put your aar file in libs folder then right click on that file and choose add as library and then sync now. it will be added to your project.

PRATEEK BHARDWAJ
  • 2,364
  • 2
  • 21
  • 35