Gradle排除arm64库 [英] Gradle exclude arm64 libs
问题描述
我有一个包含两个库的应用程序,这两个库都依赖于本机库.两者都使用gradle包含在内,因此结构如下所示:
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:
MyApp
- Libary1
-- x86, armeabi native libs
- Library2
-- Library3
--- x86, armeabi, arm64-v8a
我想删除arm64支持,因为我还需要* .so用于Library1,而我没有. (因此,目前我在arm64设备上收到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)
我已经尝试过:(使用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文件...我缺少什么吗?如果本地库在依赖关系层次结构内部更深,那abiFilter的东西甚至应该也可以工作?
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?
预先感谢您的支持:)
推荐答案
我找到了一个解决方案,排除了我不想支持的体系结构中刚刚添加的特定* .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'
}
这篇关于Gradle排除arm64库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!