Android studio中添加外部lib

1) 将外置lib copy到project->app->libs下
2) File->Project Structure->Dependencies->添加lib,并移到最上面
3) 更改build.gradle
project->gradle->build.gradle
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xbootclasspath/p:app\libs\classes-full-debug.jar')
}
}

  1. 调整app.iml调整lib引用顺序
    project->app->src->app.iml
    将外置lib移到SDK前面:

你可能感兴趣的:(Android studio中添加外部lib)