Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I exclude ABI from Android App Bundle?

I know that there was an option to exclude ABIs when generating splits in Gradle which looked like this:

android {
  splits {

    // Configures multiple APKs based on ABI.
    abi {

      // Enables building multiple APKs per ABI.
      enable true

      // By default all ABIs are included, so use reset() and include to specify that we only
      // want APKs for x86 and x86_64.

      // Resets the list of ABIs that Gradle should create APKs for to none.
      reset()

      // Specifies a list of ABIs that Gradle should create APKs for.
      include "x86", "x86_64"
    }
  }
}

And here is the official reference to splits configuration

Now it is recommended to use App Bundles when publishing your App to Play Store and I don't see any option to exclude ABIs from this bundle either by using Gradle or Play Store publishing console.

The only clue I found so far is that you can enable/disable a particular split variant. For example here is how to disable ABI bundle splitting completely according to documentation:

android {
    // When building Android App Bundles, the splits block is ignored.
    splits {...}

    // Instead, use the bundle block to control which types of configuration APKs
    // you want your app bundle to support.
    bundle {
        abi {
            // This property is set to true by default.
            enableSplit = true
        }
    }
}

But there no mention on how to disable/enable a specific ABI set.

I already have abiFilters specified to exclude not supported NDKs, but it looks like it has no influence on App Bundle.

Update: I assumed that abiFilters are specifying ABIs to exclude from the App Bundle but it was exactly opposite and their porpose is to list ABIs to be included. After this clarification, everything seems to be working correctly.

like image 214
git pull origin Avatar asked Nov 16 '25 18:11

git pull origin


1 Answers

abiFilters is the way to go. Specify the list of ABIs you want to include, and the other ones will be excluded.

You don't need the "splits" block for Android App Bundles: it's ignored.

If this doesn't work for you, then could you please provide the Gradle config with the abiFilters set, and say how you determine the ABIs present in the App Bundle?

like image 123
Pierre Avatar answered Nov 18 '25 08:11

Pierre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!