3.1 KiB
3.1 KiB
Building LifeFlow APK
This guide explains how to build the LifeFlow Android APK.
Prerequisites
- Linux/macOS/Windows with bash
- Git
- 10GB free disk space
Step-by-Step Build Instructions
1. Clone Repository
git clone https://git.lemonlink.eu/impulsivefps/LifeFlow.git
cd LifeFlow
2. Install Flutter SDK
Option A: Using the provided script (Linux/macOS)
bash scripts/install_flutter.sh
source ~/.bashrc
flutter doctor
Option B: Manual Installation
- Download Flutter from: https://docs.flutter.dev/get-started/install
- Extract to a location (e.g.,
/opt/flutterorC:\flutter) - Add to PATH:
# Linux/macOS - add to ~/.bashrc or ~/.zshrc export PATH="$PATH:/opt/flutter/bin" # Windows - add to System Environment Variables C:\flutter\bin
3. Verify Installation
flutter doctor
You should see checkmarks for:
- [✓] Flutter (Channel stable)
- [✓] Android toolchain
- [✓] Android Studio (optional but recommended)
4. Get Dependencies
cd android
flutter pub get
5. Build APK
Debug APK (for testing)
flutter build apk --debug
Output: build/app/outputs/flutter-apk/app-debug.apk
Release APK (for distribution)
flutter build apk --release
Output: build/app/outputs/flutter-apk/app-release.apk
6. Install on Device
Option A: USB Installation
- Connect Android device with USB debugging enabled
- Run:
flutter install
Option B: Manual Installation
- Copy APK to device
- Open file manager on device
- Tap APK to install (may need to allow "Unknown Sources")
Troubleshooting
"flutter: command not found"
Solution: Flutter not in PATH
export PATH="$PATH:/opt/flutter/bin"
# Or wherever you installed Flutter
"Android SDK not found"
Solution: Install Android Studio or Android SDK Command Line Tools
# Download from: https://developer.android.com/studio
# Or use sdkmanager
"Gradle build failed"
Solution: Clean and rebuild
flutter clean
flutter pub get
flutter build apk --release
"Out of memory"
Solution: Increase heap size
export GRADLE_OPTS="-Xmx4g"
flutter build apk --release
Build for Other Platforms
Windows
flutter build windows --release
Output: build/windows/x64/runner/Release/
Linux
flutter build linux --release
Output: build/linux/x64/release/bundle/
macOS
flutter build macos --release
Output: build/macos/Build/Products/Release/
Automated Build (CI/CD)
For GitHub Actions automated builds, see .github/workflows/ (to be added).
APK Size Optimization
The default release APK includes debug symbols. To create a smaller APK:
flutter build apk --release --split-debug-info=symbols
Or build an App Bundle (recommended for Play Store):
flutter build appbundle --release
Need Help?
- Check Flutter documentation: https://docs.flutter.dev
- Open an issue: https://git.lemonlink.eu/impulsivefps/LifeFlow/issues