I want to add an external library to my Android Studio 1.0 project. The other answers at stackoverflow seem to be outdated. At least I can't find a "lib" folder in my project and don't know how to create one.
edit: As I was pointing out I am referring to the latest version of Android Studio. I assume there are some differences between this version and the one referred to. The shortcuts are not working and my folder structor varies a lot. I created a new HelloWorld project to verify it.
Unlike JAR files, AAR files offer the following functionality for Android applications: AAR files can contain Android resources and a manifest file, which allows you to bundle in shared resources like layouts and drawables in addition to Java classes and methods.
Go to File > Project Structure in Android Studio. Select the app module in the Modules list on the left. Select the Dependencies tab. Click the + button on the lower left to add the dependency.
Right click on the app folder -> Open Module settings -> go to the dependencies tab -> Click on the '+' button -> click on Module Dependency. The library module will be then added to the project's dependencies.
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.
In the module that want to use the jar, create a lib
folder and place your jar in it.
In the module build.gradle
file, add this in the dependencies
group:
compile files('lib/my_jar.jar')
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