简体   繁体   中英

Built android library module doesn't have its dependencies inside

I built an Android library module which has some dependencies ( .aar files inside its libs directory). If I import the built .aar file into another project, its dependencies not resolved.

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    //compile project(':ExoPlayer')
    compile(name: 'ExoPlayer', ext: 'aar')
    compile(name: 'Volley', ext: 'aar')
    compile 'com.danikula:videocache:2.3.4'
}

The aar file doesn't contain the nested (or transitive ) dependencies and doesn't have a pom file which describes the dependencies used by the library.

It means that, if you are importing a aar file using a flatDir repo you have to specify the dependencies also in your project .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM