Search code examples
androideclipseandroid-studiolibs

Eclipse library jar files in Android studio


image here

In the picture you can see the libs folder and it contans two sub folders and a jar file named unity classes. I want to merge this project with my android studio project so in this case i want to copy my eclipse project java files, res folder and libs and everything. I copied everything in my android studio project but confused that how to copy libs folder from eclipse to android studio. I know that there is a compile ' ' option in build.gradle but what to write their? I am a newbie so please tell me what to do? I just want these libs folder to be written in android studio


Solution

  • Create a libs folder

    • -Add your jars to this folder(Copy and paste them).
    • -Right click on the jar-> Synchronize 'your.jar name'

    Finally just add below code in your gradle, This will add all the jars

    dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
    }
    

    You can also add separate jar by :

    compile files('libs/yourJarName.jar')