Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set build and version number of Flutter app

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.

like image 575
Suragch Avatar asked Jan 25 '19 00:01

Suragch


1 Answers

Setting the version and 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

  • The version name is 2.0.0
  • The version code is 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

Re-enabling auto versioning

If your Flutter versioning is not automatically updating anymore, see this answer for how to fix it.

See also:

  • How to get build and version number of Flutter app
like image 112
Suragch Avatar answered Sep 20 '22 06:09

Suragch