0

I have an app A with dependencies B and C. B has native libraries for both armeabi and armeabi-v7a. C only has native libraries for armeabi. The app fails to run on an armeabi-v7a device. (UnsatisfiedLinkError.) If I run an app depending only on B or only on C, it works fine. As near as I understand, the phone looks for armeabi-v7a libraries, and if it finds any (e.g. B), it stops looking, and so does not find any C libraries. If it does not find any v7a libraries, it continues on and finds the armeabi libraries. Is there a way to tell Gradle to hide B's armeabi-v7a libraries, or promote C's armeabi libraries? Or to tell it to copy the eventual armeabi folder into armeabi-v7a, or something?

I've seen a number of similar questions, but they seem to deal with manually-included libraries, or don't really have a clear solution.

Surely I'm not expected to repackage my dependencies by hand, just because one of them includes an extra architecture?

Erhannis
  • 4,256
  • 4
  • 34
  • 48
  • 1
    _"Is there a way to tell Gradle to hide B's armeabi-v7a libraries"_. The normal way of doing this would be to specify an `abiFilters` that only includes `armeabi`. But I don't know if the Android Gradle plugin even recognizes `armeabi` as a valid ABI anymore, since it was deprecated long ago. You may be able to use `packagingOptions { exclude` to exclude the `armeabi-v7a` library from the APK/AAB. – Michael Dec 16 '20 at 07:16
  • Note that you probably won't be able to publish your app on Google Play if it only includes armeabi libraries, since there's a 64-bit requirement nowadays. – Michael Dec 16 '20 at 07:17
  • @Michael Oh, whaddayaknow, it worked! Thanks! If you want to make it an answer, I'll accept it. – Erhannis Dec 17 '20 at 00:13

0 Answers0