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.

how to add jar file

  • To see the libs directory click the left side drop down menu “android” and choose “project” to see libs folders.

how to add jar file

  • copy the jar file and paste into libs directory.

how to add jar file in android studio

  • The last step is sync the project.

sync

Note:

There is a file called build.gradle inside app directory. if it contains following

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

how to add jar file in android studio video instruction