【问题标题】:Invalid SplitApkBundle. The bundle targets unknown languages: [gr]. google play console无效的 SplitApkBundle。该捆绑包以未知语言为目标:[gr]。谷歌游戏控制台
【发布时间】:2020-01-11 12:32:10
【问题描述】:

Android 应用程序包上传失败并出现错误

Invalid SplitApkBundle. The bundle targets unknown languages: [gr]

Android Studio 3.5 版

我试过了

  1. 清理和重建
  2. 使缓存无效/重启

【问题讨论】:

  • 我刚刚遇到了同样的问题。可能与 Google Play 相关。
  • 自 15 分钟前我也发生了同样的事情,买它时说“[cb]”。我也在使用 AS 3.5,但在过去的几天里,我可以毫无问题地上传捆绑包,所以正如@RubenAalders 所说,它一定是谷歌播放的东西

标签: android android-studio google-play-console android-app-bundle


【解决方案1】:

我遇到了同样的问题。
SplitApkBundle 无效。该捆绑包以未知语言为目标:[cb]

我通过设置 DSL 来阻止 aapt 包构建错误的语言目标来解决问题。

我的应用支持英文和中文,因此 resConfigs 只需要 en 和 zh。

defaultConfig {
    ...
    resConfigs "en", "zh-rTW", "zh-rCN"
}

【讨论】:

  • 这确实有帮助,但是当我没有定义任何语言时,为什么谷歌会假定其他语言?
  • 这对我有帮助。谢谢
  • @SEG.Veenstra - 可能是由于您使用的插件/库。这很烦人,而且很难找到/删除。
  • 我在使用“网络”语言时遇到了同样的问题!在 resConfigs 中添加应用支持的语言解决了这个问题。
【解决方案2】:

将此应用到 Android{}

bundle {
    density {
        // Different APKs are generated for devices with different screen densities; true by default.
        enableSplit true
    }
    abi {
        // Different APKs are generated for devices with different CPU architectures; true by default.
        enableSplit true
    }
    language {
        // This is disabled so that the App Bundle does NOT split the APK for each language.
        // We're gonna use the same APK for all languages.
        enableSplit false
    }
}

【讨论】:

    【解决方案3】:

    在我的情况下,我是因为我使用的是 facebook 帐户工具包,请参阅 Wells 的回答,它帮助了我,我将其列在这里以供将来参考

    bundle {
        density {
            // Different APKs are generated for devices with different screen densities; true by default.
            enableSplit true
        }
        abi {
            // Different APKs are generated for devices with different CPU architectures; true by default.
            enableSplit true
        }
        language {
            // This is disabled so that the App Bundle does NOT split the APK for each language.
            // We're gonna use the same APK for all languages.
            enableSplit false
        }
    }
    

    【讨论】:

      【解决方案4】:

      在将 facebook 登录实现降级到 5.8 后,我遇到了同样的问题,它已修复

      implementation 'com.facebook.android:facebook-login:5.8.0'
      

      【讨论】:

      • 将 facebook-login 从 5.11.0 降级到 5.8.0 修复。
      【解决方案5】:

      就我而言,我也在使用本地化和翻译。有效。没有更多的代码。

      将此代码放入应用级 build.gradle。

      android {
          bundle {
              language {
                  enableSplit = false
              }
          }
      
          ...
      
      }
      

      【讨论】:

        【解决方案6】:

        我也面临同样的问题,我猜这与为 Facebook 的 Account Kit 添加的一些资源有关(特别是 /res/values-cb/values-cb 中的值)。 xml) 我试过上传没有这个 SDK 的版本,并且 playstore 正确处理了它

        【讨论】:

        • 我从未使用过 Facebook sdk
        • @FarhanAli 你做了什么,我用了FB Account Kit,还需要用。
        【解决方案7】:

        切换到 Facebook sdk 版本 5.13.0 为我解决了这个问题。

        implementation 'com.facebook.android:facebook-login:5.13.0'
        

        【讨论】:

          猜你喜欢
          • 2020-01-12
          • 2017-11-20
          • 2020-06-03
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2010-12-12
          相关资源
          最近更新 更多