Split assets by ABI on Android : <p>I've seen <a href="https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split" rel="noreferrer">this guide</a> on how to build split APKs for each ABI.</p>

<p>However my app embeds a bunch of native executables as assets. Is it possible to filter them based on the ABI?</p>

<p>Relevant parts of <code>build.gradle</code>:</p>

<pre><code>android {
    ...
    splits {
        abi {
            enable true
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
            // builds assets and places them in src/main/assets
        }
    }
    sourceSets {
        main {
            assets.srcDirs = ['src/main/assets']
        }
    }
}
</code></pre>

<p>Sample app tree after building native executables with CMake:</p>

<pre><code>src
  + main
      + assets
          + x86
          |   + native-x86.bin
          + x86_64
          |   + native-x86_64.bin
          + armeabi-v7a
          |   + native-arm.bin
          + arm64-v8a
              + native-aarch64.bin
</code></pre>

<p>Each ABI directory contains native binaries</p>

<p>I would like each split APK to contain only the ABI-specific assets directory, with the other ones filtered. For example, for the arm64 APK:</p>

<pre><code>assets
   + arm64-v8a
       + native-aarch64.bin
</code></pre>
