英文:
How to remove unnecessary external library files from Android apk?
问题
我正在使用FFmpegKit对音频文件进行重新采样。
apk文件夹中包含许多位于lib文件夹中的SO文件。
我相信其中只有少数几个SO文件与我相关。因此,为了减小apk文件的大小,我想逐个删除这些SO文件并测试功能。
我应该如何操作?
英文:
I am using FFmpegKit to resample audio files.
The apk contains many SO files in the lib folder.
I believe that only a few of these SO files are relevant to me. So, in order to reduce the apk size, I would like to remove these SO files one by one and test the functionality.
How should I go about doing this?
答案1
得分: 1
你可以将这些代码行放入Gradle文件的android块中,以排除不必要的.so文件,如下所示:
android {
// ...
packagingOptions {
resources {
excludes += "lib/*/libavformat.so"
excludes += "lib/*/libavfilter.so"
}
}
}
英文:
You can put these lines of code in the android block of your Gradle file to exclude unnecessary .so
files like this:
android {
// ...
packagingOptions {
resources {
excludes += "lib/*/libavformat.so"
excludes += "lib/*/libavfilter.so"
}
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论