如何在Flutter中更改Windows构建版本名称?

huangapple go评论64阅读模式
英文:

How to change windows build version name in Flutter?

问题

我的Flutter版本是3.3.6。

我使用Flutter创建了一个Windows可执行文件应用,但它的版本号始终为1.0.0.0。我尝试在pubspec.yaml文件中更改版本号,但没有效果。我还尝试在打包命令中传递参数,但也没有生效。

fvm flutter build windows --build-name=1.0.3 --build-number=3

有谁知道应该怎么做?

英文:

My version of Flutter is 3.3.6.

I created a Windows exe application with Flutter, but its version number has always been 1.0.0.0. I tried to change the version in pubspec.yaml, which has no effect. I tried to pass parameters in the packaging command, but it didn't take effect.

fvm flutter build windows --build-name=1.0.3 --build-number=3

Does anyone know what to do?

答案1

得分: 1

1- 在pubspec.yaml中更改版本号。

2- 运行以下命令:

flutter build windows --build-name=1.0.3 --build-number=3
英文:

**1- change version in pubspec.yaml 如何在Flutter中更改Windows构建版本名称?**

2- run command:

flutter build windows --build-name=1.0.3 --build-number=3

如何在Flutter中更改Windows构建版本名称?

答案2

得分: 0

以下是翻译好的内容:

  1. 使用 flutter --version 验证您的Flutter版本是否为3.3或更新版本。

  2. 如果需要,使用 flutter upgrade 来更新到最新版本的Flutter SDK。

  3. 备份您的项目,可以使用git或其他版本控制系统来进行备份。

  4. 删除 windows/runner/CMakeLists.txtwindows/runner/Runner.rc 文件。

  5. 运行 flutter create --platforms=windows .

  6. 查看对 windows/runner/CMakeLists.txtwindows/runner/Runner.rc 文件所做的更改。

  7. 使用 flutter build windows 验证您的应用程序是否能够构建。

更多信息请参考:https://docs.flutter.dev/development/platform-integration/windows/version-migration

英文:

Your project can be updated using these steps:

  1. Verify you are on Flutter version 3.3 or newer using flutter --version

  2. If needed, use flutter upgrade to update to the latest version of the Flutter SDK

  3. Backup your project, possibly using git or some other version control system

  4. Delete the windows/runner/CMakeLists.txt and windows/runner/Runner.rc files

  5. Run flutter create --platforms=windows .

  6. Review the changes to your windows/runner/CMakeLists.txt and windows/runner/Runner.rc files

  7. Verify your app builds using flutter build windows

https://docs.flutter.dev/development/platform-integration/windows/version-migration

huangapple
  • 本文由 发表于 2023年2月8日 17:12:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75383476.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定