How do I exclude ABI from Android App Bundle?

て烟熏妆下的殇ゞ 提交于 2020-04-15 20:48:07

问题


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.


回答1:


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?



来源:https://stackoverflow.com/questions/54096295/how-do-i-exclude-abi-from-android-app-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!