如何解决拆分的APK和捆绑软件的版本代码之间的冲突? [英] How to resolve conflict between version codes of splitted apks and bundles?

查看:112
本文介绍了如何解决拆分的APK和捆绑软件的版本代码之间的冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去,我在gradle文件中使用以下配置来通过apk拆分生成版本代码:

In the past I used the following configuration in my gradle file for version code generation using apk splitting:

splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
            universalApk true
        }
    }


project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5,
                                'mips64' : 6, 'x86': 8, 'x86_64': 9]

    android.applicationVariants.all { variant ->
        variant.outputs.each { output ->
            output.versionCodeOverride =
                    project.ext.versionCodes.get(output.getFilter(
                            com.android.build.OutputFile.ABI), 0) * 10000000 +
                            android.defaultConfig.versionCode
        }
    }

使用此配置,我得到的版本代码如下x86,armeabi-v7a和armeabi分别为80000034、20000034、10000034。

Using this configuration I get version codes like 80000034, 20000034, 10000034 for x86, armeabi-v7a, armeabi respectively.

由于我们现在可以使用应用捆绑包,因此我想跳过此代码并直接使用捆绑包

Since we can use App Bundles now, I would like to skip this code and use directly the bundles.

但是当我尝试上传捆绑软件时,我收到了错误消息,指出与拆分的apk相比,捆绑软件的版本代码更低。
捆绑包的版本代码为35,显然小于10000034。
这导致以下事实:由于版本冲突,用户不会收到任何更新。

But when I try to upload the bundle, I get the error message, which states that the version code of my bundle is lower, compared to my splitted apks. The bundle gets version code 35, which is obviously less than 10000034. This results in the fact, that the users would not receive any updates because of the version conflict.

您能告诉我如何解决拆分的apk和捆绑包的版本代码之间的冲突吗?

Can you tell me, how to resolve conflict between version codes of splitted apks and bundles?

推荐答案

使用versionCode 90000035,因为这是您的用户之前收到的所有其他版本的第一个数字。

Use versionCode 90000035, since that's the first number higher than all other versions that your users received before.

这篇关于如何解决拆分的APK和捆绑软件的版本代码之间的冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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