Source: StackOverflow, Quora, StackOverflow
Question: Add java library to Android Studio project with maven repository?
Answer: These modifications go in the build.gradle file in your module's directory (not the build file in the project root directory).
First, set up the repository where it can find the dependency.