-
-
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: Koala Feature Drop | 2024.1.2 or newer
- Download: Android Studio
- Components: Android SDK, SDK Tools, Platform Tools
- Version: JDK 17 (required for Kotlin 1.9.22)
- Download: Oracle JDK 17 or OpenJDK 17
- 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:
- File β Project Structure β SDK Location
- Under JDK Location, verify JDK 17 is selected
- If not, click Download JDK and select version 17
Required SDK components:
- Tools β SDK Manager
-
SDK Platforms tab:
- β Android 14.0 (API 34) - 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 = 36
defaultConfig {
applicationId = "chromahub.rhythm.app"
minSdk = 26 // Android 8.0
targetSdk = 36 // Android 16
versionCode = 40310853
versionName = "4.0.310.853"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}Rhythm supports multiple build variants:
./gradlew assembleDebug- Output:
app/build/outputs/apk/debug/app-debug.apk - Features: Debugging enabled, logs enabled
- Signing: Debug keystore (auto-generated)
./gradlew assembleRelease- Output:
app/build/outputs/apk/release/app-release-unsigned.apk - Features: Optimized, 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 keystore.properties in project root (do NOT commit this file):
storePassword=YourStorePassword
keyPassword=YourKeyPassword
keyAlias=rhythm-key
storeFile=../rhythm-release-key.jksUpdate app/build.gradle.kts:
android {
signingConfigs {
create("release") {
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["storePassword"] as String
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
}
}
buildTypes {
release {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
}./gradlew assembleReleaseOutput: app/build/outputs/apk/release/app-release.apk
Windows:
gradlew.bat clean assembleDebugmacOS/Linux:
./gradlew clean assembleDebug# Clean build artifacts
./gradlew clean
# Build debug APK
./gradlew assembleDebug
# Build release APK
./gradlew assembleRelease
# Run unit tests
./gradlew test
# Run lint checks
./gradlew lint
# Install debug APK on connected device
./gradlew installDebug
# Build and install
./gradlew clean assembleDebug installDebug- 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 17 is configured in Android Studio.
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/debug/app-debug.apk - Size: ~50-60 MB
- Signing: Debug keystore
- Debuggable: Yes
- Optimized: No
-
Path:
app/build/outputs/apk/release/app-release.apk - Size: ~30-40 MB (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 17
uses: actions/setup-java@v3
with:
java-version: '17'
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
- 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.