1. Create Lib folder in your root project directory.
2. Copy your jar file to Lib folder.
3. Add following to build.gradle
// create Lib under [root.Project.name="MyProject"] from setting.gradle
// add following to build.gradle
dependencies {
compile fileTree('Lib') // this includes all the files under 'Lib'
}
Note: Make sure you sync Gradle files in Intellij[2016.3 CE] after you change the build.gradle file.
You might see the following screenshot after you modify build.gradle, and click on [apply suggestion]
Warning: If you still can not detect the jar file, then you need to close Intellij and reimport your gradle project.