• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

修改flutter项目在android对应的版本号

武飞扬头像
BgGod
帮助1

如何修改flutter项目在android中对应的版本号

在原生Android原生开发中我们用versionName、versionCode代表版本号和版本code,那么我们在flutter项目中,如何配置这两个值呢?


通过修改pubspec.yaml文件中的version属性即可,下面1.0.0 1中用“ ”号分割:

versionName versionCode
1.0.0 1

1.0.0代表Android中的versionName,1代表versionCode,根据实际需要相应修改即可,例如:
versionName是2.0.0,versionCode是2,则修 version修改为2.0.0 2即可

# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0 1

environment:
  sdk: ">=2.17.3 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgbkigf
系列文章
更多 icon
同类精品
更多 icon
继续加载