Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

android - Gradle exclude arm64 libs

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

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)

I already tried this: (with abiFilters "armeabi", "x86") https://stackoverflow.com/a/30799825/3325222

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?

Thanks in advance for any support :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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'
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...