英文:
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 **
2- run command:
flutter build windows --build-name=1.0.3 --build-number=3
答案2
得分: 0
以下是翻译好的内容:
-
使用
flutter --version
验证您的Flutter版本是否为3.3或更新版本。 -
如果需要,使用
flutter upgrade
来更新到最新版本的Flutter SDK。 -
备份您的项目,可以使用git或其他版本控制系统来进行备份。
-
删除
windows/runner/CMakeLists.txt
和windows/runner/Runner.rc
文件。 -
运行
flutter create --platforms=windows .
-
查看对
windows/runner/CMakeLists.txt
和windows/runner/Runner.rc
文件所做的更改。 -
使用
flutter build windows
验证您的应用程序是否能够构建。
更多信息请参考:https://docs.flutter.dev/development/platform-integration/windows/version-migration
英文:
Your project can be updated using these steps:
-
Verify you are on Flutter version 3.3 or newer using
flutter --version
-
If needed, use flutter upgrade to update to the latest version of the Flutter SDK
-
Backup your project, possibly using git or some other version control system
-
Delete the
windows/runner/CMakeLists.txt
andwindows/runner/Runner.rc files
-
Run
flutter create --platforms=windows .
-
Review the changes to your
windows/runner/CMakeLists.txt
andwindows/runner/Runner.rc files
-
Verify your app builds using
flutter build windows
https://docs.flutter.dev/development/platform-integration/windows/version-migration
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论