美文网首页
Android studio中添加外部lib

Android studio中添加外部lib

作者: proud2008 | 来源:发表于2018-11-07 10:23 被阅读9次

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前面:
    <orderEntry type="library" exported="" name="classes-full-debug" level="project" />
    <orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />

相关文章

网友评论

      本文标题:Android studio中添加外部lib

      本文链接:https://www.haomeiwen.com/subject/czgsgftx.html