Code2care : TechZone Apps & Tutorials

How to Import External Jars to Android Studio 1.0.1 Project



To import an external .jar file in your Android Studio Project, just follow the below steps,


    Step 1 : Move from Android view to Projects view

    Step 2 : Now under app folder you should see libs, if you don't see it, create it

    Step 3 : Drag & Drop the .jar file here, you may be get a prompt "This file does not belong to the project", just click OK

    Step 4 : Now you should see the jar file under libs folder, right click on the jar file and select "Add as library", Click OK for prompt "Create Library"

    Step 5 : Thats it!! Now this jar has been added.



Importing external jar to android studio demoImporting external jar to android studio demo


add to library


Note : We do not need to add the dependency in build.gradle manually unlike previous versions of Android Studio. But to verify, just move to the Android Project View again and check Gradle Scripts -> build.gradle , you should be able to see the the jar added under dependencies , nineoldandroids-2.2.0.jar is the jar that i have added.

e.g. :

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile files('libs/nineoldandroids-2.2.0.jar')

}


Note that the process to add an external Project Folder to an Android Studio Project is not the same.











Top




Posts related to androidstudio.


1. Building library Gradle Project Info: Downloading services.gradle.org

2. How to enable line numbers in IntelliJ Android Studio for all files

3. Eclipse like Auto Import Shortcut in Intelij IDE Android Studio

4. Android Studio Ctrl Shift o auto import not working

5. Android : Neither user 10085 nor current process has android.permission.ACCESS_NETWORK_STATE

6. Unable to establish connection to adb : Android Studio Error

7. SDK Manager: failed to install : Android Studio on Windows

8. How to Import External Jars to Android Studio 1.0.1 Project

9. Can't Run SDK Manager find_java.bat issue

10. How to Configure Eclipse keymap in IntelliJ IDE

11. Official Android Studio ver 1.0 released for Developers

    more...

Posts related to intellij.


1. How to Import External Jars to Android Studio 1.0.1 Project

2. How to enable line numbers in IntelliJ Android Studio for all files

3. How to Configure Eclipse keymap in IntelliJ IDE








Popular tags
android
x 175
eclipse
x 29
notepadplusplus
x 20
macosx
x 14
sharepoint
x 14
html
x 14
mac
x 13
androidstudio
x 11




1000+ C Programs     PHP Tutorial     JSON Tutorial     Swift Tutorial     India Pinocdes     About Us     Privacy Policy


Code2care © 2012-17