Prerequisites
Before building Deeztracker Mobile, ensure you have the following installed:Required Software
Android Studio
Android Studio
- Version: Android Studio Hedgehog (2023.1.1) or later
- Download: developer.android.com/studio
- Includes Android SDK, Build Tools, and emulator support
Java Development Kit (JDK)
Java Development Kit (JDK)
- Version: JDK 8 or later (JDK 11 recommended)
- Required for: Gradle builds and Android compilation
- Java 8 compatibility is enforced via
JavaVersion.VERSION_1_8in build config
Rust Toolchain
Rust Toolchain
- Required for: Building the
rusteernative library - Installation: Install via rustup.rs
- Target: Android NDK targets (aarch64, armv7, x86_64, i686)
Android NDK
Android NDK
- Version: NDK r25c or later
- Required for: Compiling Rust code to native Android libraries
- Installation: Via Android Studio SDK Manager
SDK Configuration
The project requires:- Compile SDK: API 34 (Android 14)
- Min SDK: API 24 (Android 7.0)
- Target SDK: API 34
app/build.gradle.kts:10-16:
Cloning the Repository
Build Commands
Debug Build
Build a debug APK for testing and development:app/build/outputs/apk/debug/Deeztracker-1.1.1.apk
Debug builds include debugging symbols and are not optimized. APK size will be larger than release builds.
Release Build
Build an optimized release APK:app/build/outputs/apk/release/Deeztracker-1.1.1.apk
Running on Device/Emulator
Install Debug Build
Install Release Build
Run from Android Studio
- Open the project in Android Studio
- Select a device/emulator from the device dropdown
- Click Run (▶️) or press
Shift + F10 - The app will build, install, and launch automatically
Signing Configuration
Development Signing
Debug builds are automatically signed with the debug keystore located at:- Linux/Mac:
~/.android/debug.keystore - Windows:
C:\Users\<username>\.android\debug.keystore
Release Signing
Release builds require a custom keystore. The project is configured to usedeeztracker.jks in the root directory.
Create keystore.properties
Create a file named
keystore.properties in the project root:keystore.properties
CI/CD Signing
For automated builds (GitHub Actions, etc.), use environment variables instead ofkeystore.properties:
Build Configuration
ProGuard/R8
The project uses R8 for code shrinking and obfuscation in release builds:app/build.gradle.kts:41-46
ProGuard is currently disabled (
isMinifyEnabled = false). To enable code shrinking, set this to true and configure proguard-rules.pro as needed.Core Library Desugaring
The project uses desugaring to support Java 8+ APIs on older Android versions:app/build.gradle.kts:48-52
java.time on API 24+.
Troubleshooting
Common Issues
Build fails with 'SDK not found'
Build fails with 'SDK not found'
Solution: Set Add this to your
ANDROID_HOME environment variable:.bashrc, .zshrc, or system environment variables.Rust library build fails
Rust library build fails
Possible causes:
- Missing Rust toolchain: Install via
rustup.rs - Missing Android targets: Run:
- NDK not configured: Set
ANDROID_NDK_HOME:
rusteer library uses UniFFI to generate Kotlin bindings from Rust code (rusteer/src/bindings.rs).Signing fails: keystore not found
Signing fails: keystore not found
Error:
Keystore file '.../deeztracker.jks' not found for signing config 'release'Solutions:- Create
keystore.propertieswith correct paths (see Signing Configuration) - For CI/CD, use environment variables instead
- For debug builds, use
./gradlew assembleDebug(doesn’t require custom keystore)
Out of memory during build
Out of memory during build
Solution: Increase Gradle heap size in Or pass it via command line:
gradle.properties:gradle.properties
Duplicate class errors
Duplicate class errors
Error:
Duplicate class ... found in modules ...Solution: Clean build cache and rebuild:App crashes on launch (debug mode)
App crashes on launch (debug mode)
Check logs using Logcat:Common issues:
- Missing native libraries (rusteer .so files)
- Permissions not granted (storage access)
- Missing Deezer ARL token
Gradle Daemon Issues
If builds hang or behave unexpectedly:Cache Corruption
Gradle Tasks Reference
Build Tasks
| Task | Description |
|---|---|
./gradlew assembleDebug | Build debug APK |
./gradlew assembleRelease | Build release APK (requires signing) |
./gradlew bundleRelease | Build Android App Bundle (.aab) |
./gradlew clean | Delete all build outputs |
Installation Tasks
| Task | Description |
|---|---|
./gradlew installDebug | Install debug APK to connected device |
./gradlew installRelease | Install release APK to connected device |
./gradlew uninstallAll | Uninstall app from all connected devices |
Testing Tasks
| Task | Description |
|---|---|
./gradlew test | Run unit tests |
./gradlew connectedAndroidTest | Run instrumented tests on device |
./gradlew lint | Run Android Lint checks |
Utility Tasks
| Task | Description |
|---|---|
./gradlew dependencies | Show dependency tree |
./gradlew tasks | List all available tasks |
./gradlew --status | Show Gradle daemon status |
./gradlew --stop | Stop Gradle daemon |
Next Steps
Architecture
Understand the MVVM architecture and Rust FFI integration
Project Structure
Explore the codebase organization and key files