Currently, I do not use the "libs" folder for my third-party dependencies (it seems they are automatically added to create / intermediate / preliminary divisions), but noticed that this can help in the analysis of static code, so I would like to add this to the project. Note. I am using maven dependencies.
Do not confuse the libs folder with the build/intermediates/pre-dexed/ .
The gradle plugin for Android currently controls the build process and creates these "internal" and intermediate folders.
My question is: Are people using their own scripts to create this folder? I almost don't think this is generated once
You do not need to create this folder. The Gradle plugin for Android manages it for yours. It will also be deleted and recreated when you run the gradlew clean command.
and then manually when a newer version is available.
No. Your dependencies are defined in the build.gradle file.
When you define a new version, Gradle downloads the new dependency and updates the staging folders.
You can define your dependencies in many ways:
dependencies{ //You can create a folder and put jar files inside. You can use your favorite name, usually it is libs. compile fileTree(dir: 'libs', include: ['*.jar']) //The support libraries dependencies are in a local maven managed by SDK compile 'com.android.support:appcompat-v7:23.0.0' // A Maven dependency compile 'com.squareup.picasso:picasso:2.5.2' //A local library compile project(':mylibrary') //An aar file. It requires to define a repository. //repositories{ // flatDir{ // dirs 'libs' // } //} compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') }
source share