-
-
Notifications
You must be signed in to change notification settings - Fork 55
Build Instructions
Complete guide to building Rhythm from source code. Whether you're contributing, customizing, or just curious, this guide will get you started.
- Version: Ladybug or newer (2024.2+)
- Download: Android Studio
- Components: Android SDK, SDK Tools, Platform Tools
- Version: JDK 21 or newer (required for Gradle 9.x and AGP 9.x)
- Download: Oracle JDK 21 or OpenJDK 21
- Version: 2.30 or newer
- Download: Git
Minimum:
- RAM: 8 GB
- Storage: 10 GB free space
- OS: Windows 10/11, macOS 10.14+, or Linux (Ubuntu 18.04+)
Recommended:
- RAM: 16 GB
- Storage: 20 GB free space (SSD recommended)
- CPU: Multi-core processor
git clone https://github.com/cromaguy/Rhythm.git
cd Rhythm- Launch Android Studio
- Select Open an Existing Project
- Navigate to the cloned
Rhythmfolder - Click OK
Android Studio will automatically prompt to sync Gradle. If not:
- Click File β Sync Project with Gradle Files
- Wait for dependencies to download (~5-10 minutes first time)
- Connect Android device (Android 8.0+) via USB OR create an emulator
- Enable Developer Options and USB Debugging on your device
- Click the Run button (
βΆοΈ ) in Android Studio - Select your device/emulator
- Wait for build to complete (~3-5 minutes first build)
Ensure correct JDK version (21+):
- File β Project Structure β SDK Location
- Under JDK Location, verify JDK 21 or newer is selected
- If not, click Download JDK and select version 21
Required SDK components:
- Tools β SDK Manager
-
SDK Platforms tab:
- β Android API 37 - Compile SDK
- β Android 8.0 (API 26) - Minimum SDK
-
SDK Tools tab:
- β Android SDK Build-Tools 35.0.0
- β Android SDK Platform-Tools
- β Android SDK Command-line Tools
- Click Apply and wait for downloads
Create/edit local.properties in project root:
# Android SDK location (auto-generated)
sdk.dir=/path/to/Android/Sdk
# Optional: Gradle JVM arguments for better performance
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.parallel=true
org.gradle.caching=trueCheck app/build.gradle.kts:
android {
namespace = "chromahub.rhythm.app"
compileSdk = 37
defaultConfig {
applicationId = "chromahub.rhythm.app"
minSdk = 26 // Android 8.0
targetSdk = 37 // Android 15
versionCode = 514141085
versionName = "5.1.414.1085 Beta"
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
freeCompilerArgs.addAll(
"-opt-in=androidx.compose.material3.ExperimentalMaterial3ExpressiveApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
)
}
}
}Rhythm supports multiple build variants:
# Specific flavor (recommended)
./gradlew assembleFdroidDebug
./gradlew assembleGithubDebug- Output:
app/build/outputs/apk/fdroid/debug/orapp/build/outputs/apk/github/debug/ - Files are named
Rhythm-{versionName}-{flavorVariant}-{abi}.apk(e.g.,Rhythm-5.1.414.1085 Beta-fdroidDebug-arm64-v8a.apk) - Features: Debugging enabled, logs enabled
- Signing: Debug keystore (auto-generated)
# Specific flavor (recommended)
./gradlew assembleFdroidRelease
./gradlew assembleGithubRelease- Output:
app/build/outputs/apk/fdroid/release/orapp/build/outputs/apk/github/release/ - Features: Optimized, R8/ProGuard enabled
- Signing: Requires signing configuration
keytool -genkey -v -keystore rhythm-release-key.jks \
-keyalg RSA -keysize 2048 -validity 10000 \
-alias rhythm-keyImportant: Store this keystore securely and remember the passwords!
Create .config/keystore.properties (do NOT commit this file):
store_file=../rhythm-release-key.jks
store_password=YourStorePassword
key_alias=rhythm-key
key_password=YourKeyPasswordThe actual app/build.gradle.kts expects these specific snake_case property names and uses a getProperties() helper:
// In app/build.gradle.kts (top level)
val signingProperties = getProperties(".config/keystore.properties")
val releaseSigning = if (signingProperties != null) {
signingConfigs.create("release") {
keyAlias = signingProperties.property("key_alias")
keyPassword = signingProperties.property("key_password")
storePassword = signingProperties.property("store_password")
storeFile = rootProject.file(signingProperties.property("store_file"))
}
} else {
signingConfigs.getByName("debug")
}
// Applied to build types:
release {
signingConfig = releaseSigning
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}./gradlew assembleGithubRelease
# or
./gradlew assembleFdroidReleaseOutput: Flavor-specific directory β app/build/outputs/apk/github/release/ or app/build/outputs/apk/fdroid/release/
APK naming: Rhythm-{versionName}-{flavorVariant}-{abi}.apk
Windows:
.\gradlew.bat clean assembleGithubDebugmacOS/Linux:
./gradlew clean assembleGithubDebug# Clean build artifacts
./gradlew clean
# Build debug APK (specific flavor)
./gradlew assembleGithubDebug
./gradlew assembleFdroidDebug
# Build release APK (specific flavor)
./gradlew assembleGithubRelease
./gradlew assembleFdroidRelease
# All flavors at once
./gradlew assembleDebug
./gradlew assembleRelease
# Run unit tests
./gradlew test
# Run lint checks
./gradlew lint
# Install debug APK on connected device
./gradlew installGithubDebug
./gradlew installFdroidDebug- Settings β About Phone
- Tap Build Number 7 times
- Enter PIN/password if prompted
- Developer Options now available
- Settings β Developer Options
- Enable USB Debugging
- Connect device via USB
- Accept authorization dialog on device
adb devicesExpected output:
List of devices attached
ABC123456789 device
adb install app/build/outputs/apk/debug/app-debug.apkEdit gradle.properties:
org.gradle.jvmargs=-Xmx6144m -XX:MaxMetaspaceSize=1024m
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=trueandroid.enableBuildCache=true
android.buildCacheDir=~/.android/build-cache./gradlew --configuration-cache assembleDebug# Profile build performance
./gradlew assembleDebug --profile
# Scan report: build/reports/profile/Error:
SDK location not found. Define location with sdk.dir in the local.properties file
Solution:
Create local.properties:
sdk.dir=/path/to/Android/SdkError:
Unsupported class file major version 61
Solution: Ensure JDK 21 or newer is configured in Android Studio (File β Project Structure β SDK Location).
Error:
OutOfMemoryError: Java heap space
Solution:
Increase heap size in gradle.properties:
org.gradle.jvmargs=-Xmx8192mError:
Could not resolve all dependencies
Solution:
- Check internet connection
- Sync Gradle: File β Sync Project with Gradle Files
- Invalidate caches: File β Invalidate Caches / Restart
Error:
Failed to find Build Tools revision 35.0.0
Solution: Install missing build tools via SDK Manager.
Error:
NDK not configured
Solution: Download NDK via SDK Manager β SDK Tools β NDK (Side by side)
-
Path:
app/build/outputs/apk/{flavor}/debug/(e.g.,.../fdroid/debug/) -
File:
Rhythm-{versionName}-{flavor}Debug-{abi}.apk - Size: ~50-60 MB
- Signing: Debug keystore
- Debuggable: Yes
- Optimized: No
-
Path:
app/build/outputs/apk/{flavor}/release/(e.g.,.../fdroid/release/) -
File:
Rhythm-{versionName}-{flavor}Release-{abi}.apk - Size: ~30-40 MB (R8/ProGuard optimized)
- Signing: Release keystore
- Debuggable: No
- Optimized: Yes (R8/ProGuard)
-
Lint:
app/build/reports/lint-results.html -
Test:
app/build/reports/tests/ -
Profile:
build/reports/profile/
keytool -printcert -jarfile app-release.apkunzip -l app-release.apk- Build β Analyze APK
- Select APK file
- Review size, resources, DEX files
name: Build APK
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk./gradlew clean
rm -rf .gradle
rm -rf build
rm -rf app/buildFile β Invalidate Caches β Check all options β Invalidate and Restart
- Telegram: Rhythm Support
- Discord: Rhythm Community
- GitHub Issues: Report Build Problems
- Contributing Guide: https://github.com/cromaguy/Rhythm/wiki/Contributing
Happy Building! π If you encounter issues not covered here, please open an issue so we can improve this guide.