0

I'm adding dynamic feature to my application.

In dynamic module I have dependency with external library, which supports only arm abis.

My app supports arm and x86 abis. Additionally I have a few of native code in app module. I'm using cmake for it. Part of my app gradle file:

externalNativeBuild {
    cmake {
        path "CMakeLists.txt"
    }
}

When I try to build my bundle

./gradlew bundleDebug

I'm getting error

Execution failed for task ':app:packageDebugBundle'. 1 exception was raised by workers: com.android.tools.build.bundletool.exceptions.ValidationException: All modules with native libraries must support the same set of ABIs, but module 'dynamic_module' supports '[ARM64_V8A, ARMEABI_V7A]' and module 'base' supports '[ARM64_V8A, ARMEABI_V7A, X86, X86_64]'.

Can I add my dynamic module only for arm processors by any entry in gradle? Or if not, any idea what I should to do?

AdamN
  • 476
  • 5
  • 13
  • As the error messages says, you are supposed build or provide all libraries for every ABI that you want to support. I suppose you could do something like putting this particular library in the `assets` folder, and at runtime copy it to somewhere in your app's private filesystem area and load it with `System.load`. It will be a bit more work, and you obviously need to think about how to handle the case where the library isn't available. – Michael Aug 05 '19 at 11:03
  • The better way for me was modify external library and add there directories for x86 processors with empty .so files – AdamN Aug 18 '19 at 20:18

0 Answers0