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

3
  • Go to build-> intermediates -> exploded-aars -> your_aar -> your_classes, Is all classes there? If Yes, then there is some issue of dependencies or your aar has some issues!\ Commented Feb 20, 2017 at 12:01
  • @AndiGeeky the .aar file is there but no class of MyLib.aar Commented Feb 20, 2017 at 12:16
  • That means your .aar file is not properly generated. Generate aar again and try! Commented Feb 20, 2017 at 12:17

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.