I currently am not using the "libs" folder for my third party dependencies (it seems they are added automatically to build/intermediates/pre-dexed/) but noticed that it may help static code analysis so I would like to add it to the project. Note: I'm using maven dependencies.
My question: Are people using custom scripts to generate this folder? I hardly think that this is generated once and then manually maintained when there is a newer version available.
Please enlighten me!
Don't confuse the
libs
folder withbuild/intermediates/pre-dexed/
folder.Currently the gradle plugin for Android manages the build process and create these "internal" and intermediates folders.
You don't have to create this folder. The Gradle plugin for Android manage it for your. Also it will be deleted and recreated when your run a
gradlew clean
command.No. Your dependencies are defined in your
build.gradle
file.When you define a new version, Gradle downloads the new dependency and updates the intermediate folders.
You can define your dependencies in many ways:
With Android Studio AND Gradle, there is no need to use libs folder (except for old .jar library).
In fact you can develop Android app whitout Android Studio as in your build.gradle there is already a
apply plugin: 'com.android.application'
Gralde is using Maven or jCenter via gradle dependencies to import libraries. Gradle and Android Gradle plugin will automaticly download the libs as you sayed in a build/ folder. It is not static and can be clean with the
Clean projet
on Android Studio. Also, Android Studio will add a warning when a new library version is available automaticly in your build.gradle.Dont miss the old
libs
folder used to import .jar library