Adsense Ad

Tuesday, 16 January 2018

How to add a jar in External Libraries in android studio

STEPS

  1. First switch your folder structure from Android to Project.
enter image description here
  1. Now search for the libs folder inside app - build folder.
enter image description here
  1. Once you have pasted the .jar file inside libs folder. 
  2. Right click on the jar file and at end click on Add as library
  3. This will take care of adding compile files('libs/ojdbc14.jar') in build.gradle [You don't have to manually enter this in your build file].
enter image description here
For manually, go to build.gradle and compile attached library. (For example)

dependencies {
  .....
    compile files('libs/ojdbc14.jar')

}

click on sync project

Now you can start using the library in your project.

2 comments:

Unknown said...

java.sql.SQLException:The Network Adapter could not establish the connection

Rawa said...

java.sql.SQLException:The Network Adapter could not establish the connection