3

Currently every time I build my APK I manually need to update my build version in 2 places - which seems very unautomated and counter-intuitive (I am comparing this to the Jenkins BUILD_ID).

I understand that I must (and prefer it so) manually update the (semver) version - 0.2.0.

But surely there must be some kind of process/setting/plugin that can automatically update the +3 on every build? I have read a lot of posts and solutions, but none actually do what I would expect it to do (I don't really want pre-build hooks and perl regex scripts unless I have to).

Note: I am not yet pushing to PlayStore - just distributing APK to core team.

pubspec.yaml

version: 0.2.0+3

and

local.properties

flutter.versionName=0.2.0
flutter.versionCode=3

I am using :

  • Android Studio 4.0.2
  • Flutter 1.22
batman567
  • 698
  • 2
  • 8
  • 21

1 Answers1

1

I've been wondering the same thing since it causes issues when uploading to the app stores.

Looks like the solution is to automate this process with something like fastlane, which is what the Flutter docs seem to favor.

Fastlane: https://fastlane.tools/

Flutter docs on Continuous Delivery: https://flutter.dev/docs/deployment/cd

Fastlane increment_build_number action: https://docs.fastlane.tools/actions/increment_build_number/

Ted
  • 224
  • 2
  • 11
  • 1
    More useful discussion here: https://stackoverflow.com/questions/54357468/how-to-set-build-and-version-number-of-flutter-app – Ted Apr 03 '21 at 13:19