mirror of
https://github.com/usetrmnl/trmnl-android.git
synced 2026-04-29 13:35:26 -07:00
Metro gradle plugin requires JVM 21+. Update all JDK 17 references: - app/build.gradle.kts: sourceCompatibility, targetCompatibility, jvmTarget - .devcontainer: base image java:1-17-bookworm → java:1-21-bookworm - docs: .github/copilot-instructions.md and CLAUDE.md
Dev Container Configuration
This directory contains the development container configuration for TRMNL Android.
Features
- Base Image: Java 21 (Bookworm)
- Android SDK: Manually installed via post-create script
- Android Command Line Tools: Version 11076708
- Platform Tools: Latest version
- VS Code Extensions: Kotlin, Gradle, Java, IntelliJ keybindings, and GitHub Copilot support
Environment Variables
ANDROID_HOME:/usr/local/lib/android/sdkANDROID_SDK_ROOT:/usr/local/lib/android/sdk
Post-Create Setup
The post-create.sh script automatically:
- Downloads and installs Android SDK Command Line Tools if not present
- Accepts Android SDK licenses
- Installs Android SDK Platform 36 and Build Tools 36.0.0
- Updates SDK components
- Sets Gradle wrapper permissions
- Pre-downloads Gradle dependencies
Usage
First Time Setup
- Open the project in VS Code
- When prompted, click "Reopen in Container"
- Wait for the container to build and post-create script to complete
Alternatively, when using GitHub Codespaces:
- Click "Code" button on the repository
- Select "Codespaces" tab
- Click "Create codespace on main"
Building the Project
./gradlew assembleDebug
Running Tests
./gradlew lintKotlin testDebugUnitTest --parallel --daemon
Formatting Code
./gradlew formatKotlin
Linting Code
./gradlew lintKotlin
Connecting Android Devices
The container is configured with --privileged mode to allow ADB access to connected USB devices for on-device debugging. Your local .android directory is mounted to preserve ADB keys and settings.
Troubleshooting
SDK License Issues
If you encounter SDK license errors, run:
yes | sdkmanager --licenses
Gradle Issues
If Gradle fails to sync, try:
./gradlew clean
./gradlew --refresh-dependencies
Android SDK Not Found
Verify the environment variables:
echo $ANDROID_HOME
echo $ANDROID_SDK_ROOT
Both should point to /usr/local/lib/android/sdk.