1.在app/libs/目录下添加framework.jar包。
2.打开build->Edit Libraries and Dependencies,把libs/framework.jar放到最前面
3.在project下的build.gradle中添加:
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xbootclasspath/p:app/libs/framework.jar'
}
}
}
4.在app下的build.gradle的dependencies中添加:
compileOnly files('libs/framework.jar')
5.编译成功!