Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Android: the release APK carries ARM code only, about 12 MB smaller (#136)

Duarte Santos5448c1203494
diff --git a/docs/MOBILE.md b/docs/MOBILE.md
index e3fef7504..ed5854c06 100644
--- a/docs/MOBILE.md
+++ b/docs/MOBILE.md
@@ -153,6 +153,11 @@ tags — a merge request from a fork can build an APK, but gets an unsigned one
the key. On a `v*` tag the signed APK is also pushed to the generic package registry, which is
what the release links to.
+The release APK carries native code for ARM only (`arm64-v8a`, `armeabi-v7a`), which is every
+phone; the x86 builds of the barcode scanner's library would add about 12 MB for emulators
+alone. A debug build (`./gradlew assembleDebug`) keeps all four, so it still runs on an x86_64
+emulator.
+
To build and sign your own:
```sh
diff --git a/frontend/android/app/build.gradle b/frontend/android/app/build.gradle
index 2fe67908d..5f77084b0 100644
--- a/frontend/android/app/build.gradle
+++ b/frontend/android/app/build.gradle
@@ -20,6 +20,13 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ // The barcode scanner's ML Kit library ships a native build for four CPU families.
+ // Phones are ARM; the two x86 builds only serve emulators and a few Chromebooks, which
+ // run ARM code through translation anyway. Leaving them out takes about 12 MB off
+ // the APK. Release only: the debug build keeps x86_64 for the emulator test rig.
+ ndk {
+ abiFilters 'arm64-v8a', 'armeabi-v7a'
+ }
}
debug {
// Test build installs side-by-side with the real app: its own applicationId, so both