問題描述
我有一個包含兩個庫的應(yīng)用程序,它們都依賴于本機庫.兩者都使用 gradle 包含,因此結(jié)構(gòu)如下所示:
I have an application including two libraries, where both of them have dependencies on native libraries. Both are included using gradle so the structure looks like this:
我的應(yīng)用
- Libary1
-- x86, armeabi native libs
- Library2
-- Library3
--- x86, armeabi, arm64-v8a
我想刪除 arm64 支持,因為我還需要 *.so 用于 Library1,而我沒有.(所以目前我在 arm64 設(shè)備上遇到 UnsatisfiedLinkError)
I want to remove the arm64 support as i would also need that *.so for Library1, which i don't have. (so currently i get an UnsatisfiedLinkError on arm64 devices)
我已經(jīng)嘗試過了:(使用 abiFilters "armeabi", "x86")https://stackoverflow.com/a/30799825/3325222
I already tried this: (with abiFilters "armeabi", "x86") https://stackoverflow.com/a/30799825/3325222
但我仍然在我的 apk 中獲得 arm64 文件夾和 *.so 文件...我缺少什么嗎?如果原生庫在依賴層次結(jié)構(gòu)中更深,那 abiFilter 的東西甚至應(yīng)該可以工作,對吧?
But i still get the arm64 folder and *.so files in my apk... is there something i'm missing? That abiFilter stuff should even work if the native libs are deeper inside the dependency hierarchy right?
提前感謝您的支持:)
推薦答案
我找到了一個解決方案,方法是排除剛剛添加到我不想支持的架構(gòu)中的特定 *.so 文件:
I found a solution by excluding the specific *.so files that were just added inside the architectures i didn't want to support:
packagingOptions {
exclude 'lib/arm64-v8a/lib.so'
exclude 'lib/mips/lib.so'
}
這篇關(guān)于Gradle 排除 arm64 庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!