Prerequisites
Before building SmartTube, you’ll need:Install Java Development Kit
Install OpenJDK 14 or older (not newer!)The output should show version 14 or lower.
Install Android SDK
Download and install Android Studio or the Android command-line tools
Set up ADB (optional)
Set up Android Debug Bridge for installing builds directly to your device
Building SmartTube
Clone the Repository
Clone SmartTube with submodules:The
git submodule update --init command is essential - it pulls in required dependencies that are managed as Git submodules.Build and Install
To build and install the debug version:Replace
<device_ip_address> with your Android TV’s IP address (found in Settings > Network). Make sure ADB debugging is enabled on your device.Build Flavors
SmartTube has three product flavors, each with its own package ID:Beta
Application ID:
org.smarttube.betaLatest features and bug fixes. Recommended for most users.Stable
Application ID:
org.smarttube.stableMore tested and stable releases.F-Droid
Application ID:
app.smarttube.fdroidF-Droid compatible build.Build Types
Each flavor can be built in two configurations:-
Debug: Unsigned build with debugging enabled
- Command:
gradlew install<Flavor>Debug - Example:
gradlew installStbetaDebug
- Command:
-
Release: Optimized and signed build (requires keystore)
- Command:
gradlew install<Flavor>Release - Example:
gradlew installStbetaRelease
- Command:
ADB Connection
Connect to your Android TV device over the network:Enable ADB Debugging
Enable Developer Options
Go to Settings > About and click on Build repeatedly until developer mode is activated
Enable ADB Debugging
Go to Settings > Developer Options and enable ADB debugging and Network debugging
Verify Connection
The first time you connect, you’ll need to accept the connection on your TV. A prompt will appear asking to allow USB debugging.
Development Setup
Open in Android Studio
- Launch Android Studio
- Click Open and select the SmartTube directory
- Wait for Gradle sync to complete
- Select your build flavor from the Build Variants panel
Recommended IDE Settings
- Compile SDK Version: 31 (or as specified in build.gradle)
- Build Tools Version: As specified in build.gradle
- Min SDK: 19 (Android 4.4 KitKat)
- Target SDK: As specified in build.gradle
Architecture Information
SmartTube supports multiple CPU architectures:- armeabi-v7a: 32-bit ARM (most Android TV devices)
- arm64-v8a: 64-bit ARM (newer devices, Pixel Tablet)
- x86: 32-bit x86 (for WSL and some TV boxes)
The build generates a universal APK that includes all architectures, plus separate APKs for each architecture. The universal APK is larger but works on all supported devices.
Common Build Issues
JDK Version Error
Problem: App crashes or build fails Solution: Verify you’re using OpenJDK 14 or olderSubmodule Not Initialized
Problem: Build fails with missing dependencies Solution: Initialize submodulesADB Connection Failed
Problem: Can’t connect to Android TV device Solution:- Ensure both devices are on the same network
- Check that ADB debugging is enabled
- Try restarting ADB:
adb kill-server && adb start-server
Out of Memory
Problem: Gradle build runs out of memory Solution: Increase Gradle memory ingradle.properties
Building Release APKs
To build signed release APKs:- Create a
keystore.propertiesfile in the project root:
- Build the release version:
- Find the APK in
smarttubetv/build/outputs/apk/stbeta/release/
Additional Resources
- GitHub Repository: yuliskov/SmartTube
- Android TV Development: Android Developers Guide
- ExoPlayer Documentation: ExoPlayer GitHub