Flutter:升级Play商店的版本代码 [英] Flutter: upgrade the version code for play store

查看:128
本文介绍了Flutter:升级Play商店的版本代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Play商店中颤抖地发布了一个应用程序,现在我要上传该应用程序的新版本.我正在尝试使用以下方式更改版本代码:

i have published an application on the play store with flutter, now i want to upload a new version of the application. I am trying to change the version code with:

flutter build apk --build-name = 1.0.2 --build-number = 3

flutter build apk --build-name=1.0.2 --build-number=3

或像这样更改local.properties

or changing the local.properties like this

 flutter.versionName=2.0.0
 flutter.versionCode=2
 flutter.buildMode=release

但是每次我在Playstore上遇到错误

but everytime i get error on the playstore

您必须为APK或Android应用程序捆绑包使用其他版本代码,因为代码1已分配给另一个APK或Android应用程序捆绑包.

You must use a different version code for your APK or your Android App Bundle because the code 1 is already assigned to another APK or Android App Bundle.

推荐答案

更新 pubspec.yaml 中的 version:A.B.C+X .

Update version:A.B.C+X in pubspec.yaml.

对于Android:

A.B.C代表versionName,例如1.0.0.

X(在+之后的数字)表示versionCode,例如123等.

X (the number after the +) represents the versionCode such as 1, 2, 3, etc.

在更新pubspec文件中的version后运行flutter packages get时,将更新local.properties中的versionNameversionCode,随后在构建计算机时在build.gradle (app)中进行选择.使用flutter buildflutter run的flutter项目,最终负责为apk设置versionNameversionCode.

When you run flutter packages get after updating this version in the pubspec file, the versionName and versionCode in local.properties are updated which are later picked up in the build.gradle (app) when you build your flutter project using flutter build or flutter run which is ultimately responsible for setting the versionName and versionCode for the apk.

对于iOS:

A.B.C代表CFBundleShortVersionString,例如1.0.0.

X(在+之后的数字)表示CFBundleVersion,例如123等.

X (the number after the +) represents the CFBundleVersion such as 1, 2, 3, etc.

这篇关于Flutter:升级Play商店的版本代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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