'How to use library aar used by another library?

An app project's structure is like the following:

Foo
 app
 mylibrary
  libs
   somelib.aar 

The app uses mylibrary as follows in build.gradle:

   implementation project(path: ':mylibrary')

Is it possible for the code of the app to reference classes in somelib.aar directly? I want to avoid adding somelib.aar to both app and mylibrary.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source