1

I have setup firebase distribution with a Flutter app. I am noticing that android can receive app builds with the same build version number while iOS builds cannot.

Is there some way I can prevent this from happening in android in firebase distribution and have it require unique build as well?

lolelo
  • 698
  • 6
  • 18

2 Answers2

0

I ended using a script that sends incremented version to firebase:

It was possible to setup pubspec.yaml in such a way it syncs with the iOS and android app version and build version: How to set build and version number of Flutter app

After that it's possible to setup a custom build script reading and incrementing version like given in this GitHub issue: https://github.com/flutter/flutter/issues/41955

This makes sure that version gets incremented


# Find and increment the version number.
perl -i -pe 's/^(version:\s+\d+\.\d+\.)(\d+)(\+)(\d+)$/$1.($2+1).$3.($4+1)/e' pubspec.yaml

...Coming from the GitHub thread

lolelo
  • 698
  • 6
  • 18
0

You can use the --build-number argument in flutter build. In a GitHub action pass github.run_number for the build.

flutter build appbundle --flavor preprod --release --build-number $BUILD_NUMBER

When you upload to Firebase app distribution you will have the major version and then after it (build number).

Maybe not a perfect solution but it worked for me. I hope it can help you!

n0madzer0
  • 21
  • 1
  • 4