我想使用 stub (如 android.jar)构建我的 android 应用程序,并在运行时使用位于设备外壳中的库。
在 build.gradle 我写道:
dependencies {
provided files('mylib.jar')
}
但我仍然在instant-run.zip(mylib-classes.dex)中看到apk中的库
最佳答案
将 jar 放在 app/libs 中,并在 app/build.gradle 中添加依赖项部分:
compile fileTree(dir: 'libs', include: ['file_name.jar'])
希望这可以帮助。
关于android - 在 Android 中构建和编译外部库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43491459/