Has anyone succeeded with autoIncrement ?

Hello there,
I am trying to use the autoIncrement which is mentioned here . I am using this so the version get bumped automatically in the build server. It does work only one time , but it tried to build again, it uses the same old value. So now I need to go to app.json and increase the buildnumber manually , which does not really make any sense.

did it work for any one ?


autoIncrement is reading the current version form your project and updating it based on that,

  • if you run that on ci you need to commit those changes back to your repository(it’s not really intended for CI, but it’s possible to use it this way)
  • if you are running locally you can’t discard those changes

Thank you for your quick answer.

Why it is not intended for CI ? being used in CI is the best scenario of making use of it . Do you know how to autocommit in github without triggering the CI again ?

it’s not intended for ci because you need to commit changes back into repo which is not really an ideal process. To avoid committing those changes back into the repo we would need to keep versions of the apps on the server which introduces a different set of problems(we might implement that in the future, but for now it’s not on our roadmap).

You can name your commit with version bump in a specific way and at the start of ci job check if last commit was version bump. Or instead of using commit names, you can use cache to pass that info to the next ci job.

Yeah , it would be nice to have that on the sever.

I’m having the same problem building locally. It only works the first time, version was 1 and now is 2, but if I build again, it continues on version 2. It doesn’t work.

I was using expo build and then I migrated to EAS build. My app is now on versionCode 23, but when I build with EAS version code is bumped from 1 to 2 (“Bumping expo.android.versionCode from 1 to 2”) which will cause an error on Google Play. Is there a way to set an initial value for autoIncrement? For both iOs and Android.

Or at least make the autoIncrement work properly, so I can make the build 23 times locally until it reaches my current version.

Is there a way to set an initial value for autoIncrement? For both iOs and Android.

This is the real blocker, here, IMO.

Since the forums are not a feature request platform I have opened Ability to manage/manually override remote autoIncrement value | Voters | Expo for this.

FWIW, the client can set the remote version code to whatever it wants over the GraphQL API. So if you need a down and dirty one-time reconcilitation of the remote version code so you can increment from a known starting point, you can manually edit the applicable version.js file for the platform in question and run eas build. E.g. I just did that and:

✔ Incremented versionCode from 7 to 12.

It would be great to have some sort of command or UI for this but :person_shrugging:

eas build:version:set is the command i believe (on my phone at the moment but you can look in eas-cli —help)