I am having one .aar
file of one library module.
I want to use it as a library or dependency in my other project's library module.
How do I do it?
I tried options provided at below links:
http://kevinpelgrims.com/blog/2014/05/18/reference-a-local-aar-in-your-android-project/
It works only if I add .aar
reference in my project's application module. But not working in library module.
Thanks.
An AAR file contains a software library used for developing Android apps. It is structurally similar to an . APK file (Android Package), but it allows a developer to store a reusable component that can be used across multiple different apps.
How to find the libs folder in Android Studio? If you are unable to find the libs folder in Android studio then open your android project in “Project” mode If the project is already opened in the “Android” mode. Then go to Your Project Name > app > libs and right-click on it and paste the downloaded JAR files.
Follow this setting and you will able to add .aar
dependency to library module
build.gradle (Project: ....)
allprojects { repositories { jcenter() mavenCentral() flatDir { dirs 'libs' dirs project(':library_module').file('libs') } } }
build.gradle (Module: app)
dependencies { ... compile project(':library_module') }
build.gradle (Module: library_module)
dependencies { ... compile(name:'aar_file_name', ext:'aar') }
settings.gradle (Project Settings)
include ':app', ':library_module'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With