【问题标题】:Version Code Error while Uploading Flutter Apk to Play Store将 Flutter Apk 上传到 Play 商店时出现版本代码错误
【发布时间】:2021-04-11 05:10:38
【问题描述】:

Play 控制台出现错误“使用不同的版本代码”。

我什么都试过了。将 pubspec.yaml 中的版本代码更改为 2.0.1+2。然后运行 ​​pub get 更改 local.properties 文件中的版本代码。 Flutter Clean 然后构建发布。即使这样,Play 控制台也会出错。

【问题讨论】:

    标签: flutter apk


    【解决方案1】:

    我也遇到了同样的问题,后来才知道我的version code是在我的build.gradle文件中静态定义的。

    转到 Android -> 应用程序 -> build.gradle 文件

    要从那里更改它请检查您的 build.gradle 文件,version Code 是来自 flutterVersionCode 还是定义为 statically

    defaultConfig {
       //...
        versionCode flutterVersionCode.toInteger() //See this line, is it same as mine or you have any static version Code set there which is causing the issue.
        versionName flutterVersionName
    }
    

    【讨论】:

    • 是的,就在阅读您的答案之前,我看到了这个 defaultConfig 块,它的版本代码被静态定义为 1,所以我将其更改为 2。哈哈,我也静态地做了,但现在我知道了正确的方法。非常感谢
    猜你喜欢
    • 2018-06-29
    • 1970-01-01
    • 2019-02-23
    • 2014-01-15
    • 2018-05-04
    • 1970-01-01
    • 2020-12-15
    • 2016-08-27
    相关资源
    最近更新 更多