The folder structure is relatively important when accessing the static library, I'm going to point out the structure of mine, obviously, it will be slightly different for you, but I hope this makes the situation a little easier. Firstly:
in my (C :) drive I have a Projects folder that is home to all my Android studio projects, in this folder I have my library, as well as the root directory of the application I'm working on (which uses the library)
The next step is to open the project in which you want to use the library and include these few lines of code.
Expand "Gradle Scripts" and open "build.gradle (module: app)", and in the dependencies add this project - compile (path: ": library")
Next, open 'settings.gradle (Project Settings)' and you should see this: include ': app'
Change the line above to read include ': app', ': library' and in the line below add this - the project (": library"). projectDir = new file ("../(yourlibraryfoldernamehere)/library") '
SHOULD do the trick, hope this helps, if something is unclear, give me a shout and I will try to help or explain better! Good luck
source share