Include an External .aar File
Publish date: Mar 20, 2019
There are 2 ways to do that
First Way: Using Android Studio Menu
File -> New -> New Module -> Import .jar/.aar and import your .aar
Then in your project’s build.gradle (the one under ‘app’) add the following:
dependencies {
compile project(‘:Name-of-the-Project’)
}
Clean Build after all the above steps.
Second Way: By Creating libs Folder
Follow the following steps:
- Create ‘libs’ folder under src/main
- Copy your .aar file to src/main/libs
- Open build.gradle file(the one under ‘app’) and add in dependencies compile(name:’my_library’, ext:’aar’)
- Open the top level build.gradle file and add (below jcenter())
flatDir { dirs ‘src/main/libs’ }
- Get back to coding
Source: Medium
Disqus comments are disabled.