首页 > 解决方案 > 无效的 splitapkbundle。捆绑目标未知语言:[gr]

问题描述

上传应用程序包失败。

在我更改依赖项的版本之后

> classpath 'com.android.tools.build:gradle:3.5.0'

3.4.1 至 3.5.0

我收到这个错误。

我用这个方法解决了但是是真是假我不知道见下文

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

在此处输入图像描述

标签: javaandroidandroid-studiogradlegoogle-play-console

解决方案


有两种方法


1) 第一种方法


我通过使用这种方法解决了这个问题,但它只适用于英语

无效的 SplitApkBundle。该捆绑包针对未知语言:[gr]。

defaultConfig {
    ...
    resConfigs "en" }

2) 第二种方法


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

推荐阅读