当前位置:   article > 正文

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

flutter 版本与android sdk对应

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

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


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

versionNameversionCode
1.0.01

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/549355
推荐阅读
相关标签
  

闽ICP备14008679号