Skip to content

fix(formulus): align Android release packaging and version codes - #783

Merged
najuna-brian merged 1 commit into
OpenDataEnsemble:devfrom
HelloSapiens:fix/formulus-android-release-packaging
Aug 31, 2026
Merged

fix(formulus): align Android release packaging and version codes#783
najuna-brian merged 1 commit into
OpenDataEnsemble:devfrom
HelloSapiens:fix/formulus-android-release-packaging

Conversation

@r0ssing

@r0ssing r0ssing commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Align Android release packaging and version codes

Acknowledgements

Many thanks and ❤️ to @licaon-kter for identifying and clearly explaining the F-Droid version-code collision in #746.

We also greatly appreciate the ongoing work of the F-Droid maintainers and contributors. Their review, packaging, and reproducible-build efforts help make Formulus available through a trusted FOSS distribution channel.

Summary

Fix the Formulus Android release packaging and version-code strategy following the transition from ABI-specific GitHub APKs to a single universal APK.

This PR:

  • Moves the Android release versionCode from 36 to 40.
  • Aligns both iOS CURRENT_PROJECT_VERSION values to 40.
  • Introduces a four-code release block policy: 40, 44, 48, etc.
  • Limits normal GitHub and Google Play builds to physical ARM devices:
    • armeabi-v7a
    • arm64-v8a
  • Keeps F-Droid's four independent ABI builds, including x86 and x86_64.
  • Adds CI validation for native version and build-number alignment.
  • Updates the Android release and CI/CD documentation.

Closes #746.

Background

Version-code collision

The previous ABI-specific APK setup assigned consecutive version codes to different ABIs. For example, a base code of 36 could produce GitHub APKs with codes 3639.

F-Droid similarly derives four codes from the upstream source code:

ABI Derived code with base 40
armeabi-v7a 40
arm64-v8a 41
x86 42
x86_64 43

After switching the GitHub artifact to a universal APK, the universal build used the unmodified base code 36. Android therefore treated it as a downgrade on devices with an ABI-specific APK using code 37, 38, or 39.

Base 40 is the first code above:

  • The F-Droid 1.3.0 block (3538).
  • The old GitHub 1.3.1 split range (3639).

APK size

The four-ABI universal APK included native libraries for ARM32, ARM64, x86, and x86_64, increasing its size from approximately 36 MB to 85 MB.

Normal GitHub and Play builds now target only:

  • armeabi-v7a
  • arm64-v8a

This retains coverage for 32-bit and 64-bit physical Android devices without carrying emulator-focused x86 libraries in every direct download.

F-Droid remains able to build all four ABIs because its metadata explicitly invokes Gradle with -PabiFilters=<abi>, bypassing the normal ARM-universal configuration.

Version-code policy

Going forward, each distinct APK/AAB shipped on a GitHub Release or uploaded to Play should use the next four-code-aligned base:

40, 44, 48, 52, ...
The base is used by:

- GitHub universal APK
- Google Play AAB
- iOS `CURRENT_PROJECT_VERSION`

F-Droid reserves the full block from `base` through `base + 3`.

Ordinary branch CI artifacts do not consume a new block.

Before a release, the selected base must also be checked against the highest code already uploaded to Google Play.

## CI safeguards

Adds:

```bash
pnpm run validate:native-versions

The validator checks that:

  • Android versionCode is divisible by four.
  • Android versionName matches formulus/package.json.
  • Both iOS CURRENT_PROJECT_VERSION values match Android.
  • iOS MARKETING_VERSION matches formulus/package.json.

The Android workflow runs this validation before building.

Validation

  • pnpm run validate:native-versions
  • Prettier checks for changed Formulus files
  • ESLint for the native-version validator
  • git diff --check
  • Workflow and Gradle editor diagnostics
  • Gradle configuration with normal ARM32/ARM64 settings
  • Gradle configuration with F-Droid-style -PabiFilters=x86

A complete signed APK/AAB build was not run locally; CI will build and report the resulting artifact sizes.

@r0ssing
r0ssing requested a review from najuna-brian August 31, 2026 18:06
@najuna-brian
najuna-brian merged commit 9b83f24 into OpenDataEnsemble:dev Aug 31, 2026
10 checks passed
@r0ssing
r0ssing deleted the fix/formulus-android-release-packaging branch August 31, 2026 19:18
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.

[Android] F-Droid can't build

2 participants