How do you set the version name and version code of a Flutter app without having to go into the Android and iOS settings?
In my pubspec.yaml I have
version: 2.0.0
but I don't see a place for the build number.
You can update both the version name and the version code number in the same place in pubspec.yaml. Just separate them with a +
sign. For example:
version: 2.0.0+8
This means
2.0.0
8
This is described in the documentation of a new project (but you might have deleted that if you are working on an old project):
The following defines the version and build number for your application. A version number is three numbers separated by dots, like 1.2.43 followed by an optional build number separated by a +. Both the version and the builder number may be overridden in flutter build by specifying --build-name and --build-number, respectively. Read more about versioning at semver.org.
version: 1.0.0+1
If your Flutter versioning is not automatically updating anymore, see this answer for how to fix it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With