how to add jar file in android studio
This blog post is about how to add jar file in android studio project. The below figure show default view of android studio project. To add a jar file inside our project we need to copy the jar file inside libs directory. But here we are not able to see libs directory.
- To see the libs directory click the left side drop down menu “android” and choose “project” to see libs folders.
- copy the jar file and paste into libs directory.
- The last step is sync the project.
There is a file called build.gradle inside app directory. if it contains following
compile fileTree(dir: 'libs', include: ['*.jar'])
look at “compile fileTree(dir: ‘libs’, include: [‘*.jar’])” , it is sufficient for adding jar file to compile with your android studio project. It is not present then inside dependencies write compile files(‘libs/cocos2d-android.jar’)