如何从Android App Bundle中排除ABI? [英] How do I exclude ABI from Android App Bundle?

查看:388
本文介绍了如何从Android App Bundle中排除ABI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在Gradle中生成拆分时,可以选择排除ABI,如下所示:

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"
    }
  }
}

这是对拆分的正式引用配置

现在,建议您在将应用发布到Play商店时使用应用捆绑包,但我看不到任何通过Gradle或Play商店发布控制台。

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.

到目前为止,我发现的唯一线索是可以启用/禁用特定的拆分变体。例如,这里是如何根据文档完全禁用ABI捆绑包拆分的方法:

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
        }
    }
}

但没有提及如何禁用/启用特定的ABI集。

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

我已经为 abiFilters 指定了排除不受支持的NDK,但它似乎对App Bundle没有影响。

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

更新:我假设 abiFilters 指定要从App Bundle中排除的ABI,但这是完全相反的,其目的是列出要包括的ABI。澄清之后,一切似乎都可以正常工作。

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.

推荐答案

abiFilters 是要走的路。指定您要包括的ABI列表,其他的将被排除。

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

您不需要Android App Bundle的 splits块:将被忽略

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

如果这对您不起作用,那么您能否为Gradle配置提供 abiFilters 设置,并说出如何确定App Bundle中存在的ABI?

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?

这篇关于如何从Android App Bundle中排除ABI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆