1.add libs directory.step:
a. select module in project view
b. right key of mouse new->Directory and give name “libs”
then,it looks like this
2.copy .jar to this directory
for example:use linux cmd :cd xxx/app//libs;cp xx.jar ./libs
then,it looks like this
3.modify the build.gradle of the module
android {
...
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
repositories {
flatDir {
dirs 'libs'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
...
implementation files('libs/achartengine-1.0.0.jar')
}
...