If I'm understanding your question correctly, there are 3 projects involved:
Library Project 2 --> Library Project 1 --> Application Project
You are editing "Library Project 1" and have added to it's app/build.grade a dependency on the Library Project 2's aar. Something like this: compile 'com.arasthel:gnavdrawer-library:1.1.5'
I am not sure where you are running into an issue, but I'll attempt an answer anyway. If I'm completely off-base, can you please elaborate on how the AAR dependency is not working? Any error messages?, a class/resource not found, etc.
I think it's unlikely you are unable to use a class from Library Project 2 inside Library Project 1, because I just tried this myself and it seems to be working just fine. It's worth noting that the Library Project 1 aar file will NOT include classes or resources from Library Project 2. Library Project 2 will be noted as a dependency in Library Project 1's pom if published using gradle's maven plugin to publish Library Project 1.
My guess is that you are having a problem in the Application Project? Perhaps the class from Library Project 2 is not found in the Application Project?
If that is correct, then there are two possible solutions:
Enable transitive dependencies on the aar dependency in the Application project's app/build.gradle: Instead of compile 'com.example:myLibrary:versionX'
, make it compile('com.example:myLibrary:versionX'){transitive=true}
. I just verified this causes gradle to read Library Project 1's pom and automatically add dependencies found there into the Application Project.
If you would like to use transitive dependencies, your Library Project will need to be generating a pom and publishing it along with the aar. See https://stackoverflow.com/a/30085677/431296 for some additional information on how I have this working.
Manually add the dependency on Library Project 2 to the Application Project - so that your Application has a dependency line for both Libraries. Depending on your specific situation this may or may not be a workable solution.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…