From 4c8926a1fa32082a0e7aeb7d84bd667652695dab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 16:57:52 +0000 Subject: [PATCH] fix(mobile): switch to remote appVersionSource for auto-incrementing build numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change `appVersionSource` from `"local"` to `"remote"` in `eas.json` so EAS tracks build numbers on its servers. This ensures every CI build gets a unique, ever-increasing version without needing to commit bumps back to the repo — fixing the App Store Connect "bundle version already used" rejection. Also bump `ios.buildNumber` to "7" and `android.versionCode` to 7 in `app.json` (above the previously uploaded version "6") so the remote version initializes correctly. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- docs/MobileApp.md | 18 ++++++++++++++++++ mobile/README.md | 9 +++++++++ mobile/app.json | 4 ++-- mobile/eas.json | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/MobileApp.md b/docs/MobileApp.md index 493088e8..3cca38bd 100644 --- a/docs/MobileApp.md +++ b/docs/MobileApp.md @@ -67,6 +67,24 @@ An **EAS Cloud Workflow** (`mobile/.eas/workflows/create-builds.yml`) automates > **Prerequisite:** An App Store Connect API Key must be configured in EAS for non-interactive submission. See [Troubleshooting → "Session expired"](#session-expired-local-session-during-ios-build) below for setup instructions. +### Version Management + +Build numbers (iOS `buildNumber` / Android `versionCode`) are managed **remotely** by EAS. The `eas.json` configuration uses: + +```json +{ + "cli": { "appVersionSource": "remote" }, + "build": { "production": { "autoIncrement": true } } +} +``` + +- **`appVersionSource: "remote"`** — EAS stores the current build number on its servers instead of reading it from `app.json`. This ensures every CI build gets a unique, ever-increasing number without needing to commit version bumps back to the repository. +- **`autoIncrement: true`** — EAS automatically increments the build number before each production build. + +The `ios.buildNumber` and `android.versionCode` values in `app.json` serve as the **initial seed** when the remote version is first created; after that they are informational only. Do not rely on them for the actual version submitted to the stores. + +> **Tip:** To check or manually set the remote version, use `eas build:version:get` and `eas build:version:set`. + ## Authentication ### SSO Login Flow diff --git a/mobile/README.md b/mobile/README.md index 25649454..28f0ba37 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -88,6 +88,15 @@ An EAS Cloud Workflow (`mobile/.eas/workflows/create-builds.yml`) runs automatic > An [App Store Connect API Key](https://docs.expo.dev/app-signing/app-credentials/#app-store-connect-api-key) must be configured in EAS (`eas credentials`) for non-interactive submission. +### Version management + +Build numbers (`ios.buildNumber` / `android.versionCode`) are managed **remotely** by EAS — see `eas.json`: + +- `"appVersionSource": "remote"` — EAS tracks the current build number on its servers, so each CI build automatically receives a unique, incrementing number without committing changes back to the repo. +- `"autoIncrement": true` (production profile) — EAS bumps the build number before every production build. + +The values in `app.json` are used as the **initial seed** when the remote version is first created; after that they are informational only. Use `eas build:version:get` / `eas build:version:set` to inspect or override the remote version. + ## Configuration No code changes are needed to point the app at a different server. The server URL is entered by the user on the login screen and stored in the device's secure store. diff --git a/mobile/app.json b/mobile/app.json index 1c9a23a7..419f7945 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -44,7 +44,7 @@ } ] }, - "buildNumber": "3" + "buildNumber": "7" }, "android": { "adaptiveIcon": { @@ -71,7 +71,7 @@ "category": ["DEFAULT"] } ], - "versionCode": 1 + "versionCode": 7 }, "web": { "favicon": "./assets/favicon.png", diff --git a/mobile/eas.json b/mobile/eas.json index 8633ced0..9db5ecc1 100644 --- a/mobile/eas.json +++ b/mobile/eas.json @@ -1,7 +1,7 @@ { "cli": { "version": ">= 5.9.0", - "appVersionSource": "local" + "appVersionSource": "remote" }, "build": { "development": {