Build, sign and publish on Google Play
This guide shows how to build the FitHub member app for Android from this project and publish it. The app is one app for every gym: the member enters (or scans) the gym code and the app takes that gym's name, logo, colours, welcome message and sections. You publish it once from your own account; gym owners rebrand it from the owner panel under Website → App.
The app talks to your FitHub installation through its API at https://your-domain.com/api/v1. Install the web system first and make sure that address opens (it answers with data, not a page).
flutter doctor must show no errors for Android.android_app folder in Android Studio or VS Code and run flutter pub get.android:label in android/app/src/main/AndroidManifest.xml (default FitHub).com.fithub.fithub_member. Change namespace and applicationId in android/app/build.gradle.kts to your own id (for example com.yourcompany.gymapp) before you publish. The id cannot be changed after the first upload to Google Play. If you rename it, also move the Kotlin folder under android/app/src/main/kotlin and update its package line.ic_launcher.png files in the android/app/src/main/res/mipmap-* folders.version: 1.0.0+1 in pubspec.yaml (name+build number). Raise the build number for every upload.Connect a phone or start an emulator and run, pointing the app at your system:
flutter run --dart-define=API_BASE_URL=https://your-domain.com/api/v1 --dart-define=APP_VERSION=1.0.0On the Android emulator the computer's own server is http://10.0.2.2/.... Enter a gym code (shown in the owner panel under Website → App), sign in with a member account and check each section. To check the code itself run flutter analyze and flutter test.
google-services.json and put it in android/app/. The build picks it up automatically; without it the app still works, just without notifications.Members then receive a notification when a class seat opens, an automatic renewal fails or the gym posts a notice. Tapping it opens the right screen.
Google Play only accepts apps signed with your own key. Create it once and keep it safe – if you lose it you cannot update the app.
keytool -genkey -v -keystore ~/fithub-upload.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
Create android/key.properties (do not share or commit it):
storePassword=YOUR_PASSWORD
keyPassword=YOUR_PASSWORD
keyAlias=upload
storeFile=/full/path/to/fithub-upload.jks
Then in android/app/build.gradle.kts load this file and use it for the release build, as described in the official Flutter guide
Sign the app. Until you do this, release builds are signed with the debug key and Google Play will refuse them.
flutter build appbundle --release --dart-define=API_BASE_URL=https://your-domain.com/api/v1 --dart-define=APP_VERSION=1.0.0
The file is created at build/app/outputs/bundle/release/app-release.aab. For a file you can install directly on a phone use flutter build apk --release with the same options.
APP_VERSION must match the version in pubspec.yaml. The app compares it with the oldest version you allow in the admin panel..aab, add release notes and submit for review. A new developer account may need to run a closed test first; the Console tells you if so.Log in as Super Admin and open Mobile app:
1.0.0 until you need to force an update.| Problem | What to check |
|---|---|
| Gym code not found | Open https://your-domain.com/api/v1/app-config in a browser; it must return data. Check the address you built with and that the server has HTTPS. |
| App asks to update | APP_VERSION is older than the oldest version allowed in Mobile app. |
| No notifications | google-services.json is in android/app/, the Firebase key is saved in the admin panel, and the member allowed notifications. |
| Camera does not open | The member must allow camera access to scan a gym QR code; typing the code always works. |