我创建了android项目并添加了具有其他平台工具/文件/库的编译依赖项,我需要从.apk文件中删除(排除)此文件。您可以在此屏幕截图上看到我要删除的文件夹:
最佳答案
minify features of proguard。
android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
...
}
另外,请记住,如果您采用了proguard路线,则需要重新评估依赖关系,并对使用反射的任何代码进行特殊异常(exception)处理。
关于android - Android如何从APK文件中排除某些文件夹,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46963975/