【发布时间】:2021-04-11 05:10:38
【问题描述】:
Play 控制台出现错误“使用不同的版本代码”。
我什么都试过了。将 pubspec.yaml 中的版本代码更改为 2.0.1+2。然后运行 pub get 更改 local.properties 文件中的版本代码。 Flutter Clean 然后构建发布。即使这样,Play 控制台也会出错。
【问题讨论】:
Play 控制台出现错误“使用不同的版本代码”。
我什么都试过了。将 pubspec.yaml 中的版本代码更改为 2.0.1+2。然后运行 pub get 更改 local.properties 文件中的版本代码。 Flutter Clean 然后构建发布。即使这样,Play 控制台也会出错。
【问题讨论】:
我也遇到了同样的问题,后来才知道我的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
}
【讨论】: