简体   繁体   中英

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

I found the answer finally. Its simple and i just have to add this line

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

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')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM