小编git*_*gin的帖子

如何从 Android App Bundle 中排除 ABI?

我知道在 Gradle 中生成拆分时有一个排除 ABI 的选项,如下所示:

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", …
Run Code Online (Sandbox Code Playgroud)

android gradle google-play android-app-bundle

4
推荐指数
1
解决办法
3336
查看次数

不必要; SDK_INT总是> = 21,而我的minSdkVersion是16

所以,我有一段代码看起来像

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2){
    // Do something
} else {
    //Do something else
}
Run Code Online (Sandbox Code Playgroud)

但Android Studio向我显示了以下针对我的if子句的警告: Unnecessary; SDK_INT is always >= 21,虽然我已经minSdkVersion设置为16.

那么,为什么我会收到这个警告,即使Build.VERSION_CODES.JELLY_BEAN_MR2 = 18我最终可能会遇到这个if子句必须有用的场景(例如16和17 SDK版本)?

sdk android android-studio

2
推荐指数
1
解决办法
780
查看次数