How to specify dependencies in aar library?

前端 未结 1 952
抹茶落季
抹茶落季 2020-12-15 20:10

I created an Android library (called MyLib) which depends on other library available on maven repo (like gson, retrofit, etc.).

M         


        
相关标签:
1条回答
  • 2020-12-15 20:48

    When publishing an aar to a maven repository (local or remote) and including it using compile (...@aar) transitive dependencies are turned off.

    To enable transitive dependencies for an aar library:

    compile ('com.mylib:mylib:1.0.0@aar'){
           transitive=true
    }
    

    You can read more about this here:

    Can an AAR include transitive dependencies?

    This works with aar libraries that are published to a remote or local maven repository, In your case it sounds like the library will not be published to even a local maven repository. I can't find any definitive information as to if it will work in your circumstances, but you should give it a shot.

    0 讨论(0)
提交回复
热议问题