Skip to content

fix(android): stop deriving versionCode from the Unix timestamp - #158

Open
1technophile wants to merge 1 commit into
developmentfrom
fix/android-versioncode-scheme
Open

1technophile wants to merge 1 commit into
developmentfrom
fix/android-versioncode-scheme

Conversation

@1technophile

Copy link
Copy Markdown
Member

Description:

Play now rejects the release with "This release's version code is significantly higher than your previous version code". versionCode was the build time in Unix seconds (~1.79e9 in late 2026), which climbs ~86 400 a day and reaches Android's 2 100 000 000 ceiling in mid-2036, after which the app could never be updated again.

CI builds now use 1800000000 + GITHUB_RUN_NUMBER: the base is above every timestamp code already issued (and stays above them until January 2027), so the switch never goes backwards, and each upload adds 1 instead of a day's worth of seconds. Local builds have no run number and keep the timestamp; they are never uploaded.

The mobile workflow is at run 435, so the next CI build will be about 1800000436.

Verified with local release builds read back with aapt2: GITHUB_RUN_NUMBER=157 gives versionCode 1800000157; without it the code is the current timestamp as before.

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

Play now rejects the release with "This release's version code is
significantly higher than your previous version code". versionCode was the
build time in Unix seconds (~1.79e9 in late 2026), which climbs ~86 400 a day
and reaches Android's 2 100 000 000 ceiling in mid-2036, after which the app
could never be updated again.

CI builds now use 1800000000 + GITHUB_RUN_NUMBER: the base is above every
timestamp code already issued (and stays above them until January 2027), so
the switch never goes backwards, and each upload adds 1 instead of a day's
worth of seconds. Local builds have no run number and keep the timestamp;
they are never uploaded.

The mobile workflow is at run 435, so the next CI build will be about
1800000436.

Verified with local release builds read back with aapt2:
GITHUB_RUN_NUMBER=157 gives versionCode 1800000157; without it the code is
the current timestamp as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant