Skip to main content
This guide will help you set up and run the Compose Project Template on your local machine. You’ll have a fully functional Android app running in less than 10 minutes.

Prerequisites

Before you begin, ensure you have the following installed:
  • Android Studio (latest stable version recommended)
  • JDK 11 or higher
  • Git for cloning the repository
  • Android SDK 26 or higher
The template targets Android API 36 but maintains compatibility with API 26+, ensuring support for approximately 95% of Android devices.

Getting started

1

Clone the repository

Clone the project from GitHub to your local machine:
git clone https://github.com/Vasylenko-S-A/Compose-Project-Template.git
cd Compose-Project-Template
2

Open in Android Studio

Launch Android Studio and select File > Open, then navigate to the cloned directory and open it.
Wait for Android Studio to finish indexing and downloading dependencies. This may take a few minutes on first launch.
3

Configure your app

Customize the application by editing buildSrc/src/main/java/es/mobiledev/buildsrc/AppConfig.kt:
buildSrc/src/main/java/es/mobiledev/buildsrc/AppConfig.kt
object AppConfig {
    const val applicationId = "com.yourcompany.yourapp"
    const val namespace = "com.yourcompany.yourapp"
    const val applicationName = "Your App Name"
    const val versionCode = 1
    const val versionName = "1.0.0"
    const val compileSdkVersion = 36
    const val targetSdkVersion = 36
    const val minSdkVersion = 26
    const val testRunner = "androidx.test.runner.AndroidJUnitRunner"
}
  • applicationId: Your unique application identifier (reverse domain notation)
  • namespace: Package namespace for generated resources
  • applicationName: Display name shown in the app launcher
  • versionCode: Integer version for internal tracking (increment for each release)
  • versionName: User-facing version string (e.g., “1.0.0”)
  • compileSdkVersion: Android SDK version to compile against
  • targetSdkVersion: Android version your app is designed for
  • minSdkVersion: Minimum Android version required to run your app
  • testRunner: Test instrumentation runner class
After modifying AppConfig.kt, sync your project:
  • Click File > Sync Project with Gradle Files
  • Or click the Sync button in the notification bar
4

Build and run

You can run the app using either an emulator or physical device:
./gradlew assembleDebug
Or simply click the Run button (▶️) in Android Studio and select your target device.
The project includes ktlint checks that run before building. If you encounter formatting errors, run ./gradlew ktlintFormat to auto-fix them.

Verify your installation

Once the app launches, you should see:
  1. A splash screen (from the launcher feature)
  2. The home screen with a bottom navigation bar
  3. Sample articles displayed in a list
These components demonstrate the multi-module architecture working together.

Project configuration files

The template uses several key configuration files:

settings.gradle.kts

Defines all modules in the project. Located at the root, it includes all feature, data, domain, and shared modules.

gradle.properties

Contains project-wide Gradle settings including JVM memory allocation and AndroidX configuration.

build.gradle.kts

Root build file that defines shared dependencies and configurations across all modules.

AppConfig.kt

Centralized configuration for app identity, versioning, and SDK versions used by all modules.

Common issues and solutions

This occurs when buildSrc hasn’t compiled yet. Solution:
  1. Clean and rebuild buildSrc: ./gradlew :buildSrc:clean :buildSrc:build
  2. Sync project with Gradle files
  3. Invalidate caches: File > Invalidate Caches / Restart
The project enforces Kotlin code style. If builds fail due to formatting:
# Auto-fix formatting issues
./gradlew ktlintFormat

# Check formatting without fixing
./gradlew ktlintCheck
If Gradle can’t resolve dependencies:
  1. Check your internet connection
  2. Clear Gradle cache: rm -rf ~/.gradle/caches/
  3. Sync project: File > Sync Project with Gradle Files
  4. Ensure you’re using a compatible Gradle version (check gradle/wrapper/gradle-wrapper.properties)
If you see errors related to Hilt dependency injection:
  1. Ensure all modules using Hilt have the plugin: alias(libs.plugins.hilt)
  2. Clean and rebuild: ./gradlew clean build
  3. Check that your Application class is annotated with @HiltAndroidApp
  4. Verify activities using Hilt are annotated with @AndroidEntryPoint
If Android Studio can’t find project modules:
  1. Verify the module exists in settings.gradle.kts
  2. Check that you’re using the correct accessor: projects.feature.home not project(":feature:home")
  3. Enable type-safe project accessors (already enabled in template)
  4. Sync project with Gradle files

Next steps

Now that you have the template running, explore these resources:

Project structure

Learn about the multi-module architecture and how modules interact

Architecture overview

Understand the Clean Architecture principles used in this template

Module organization

Learn about module organization and adding new modules

Navigation

Learn how type-safe navigation works across modules

Development workflow

Here’s a typical development workflow with this template:
1

Create a feature branch

git checkout -b feature/your-feature-name
2

Add your feature module

Create a new module under feature/ or modify existing ones.
3

Run ktlint before committing

./gradlew ktlintFormat ktlintCheck
4

Run tests

./gradlew test
5

Commit and push

git add .
git commit -m "feat: add your feature description"
git push origin feature/your-feature-name

Additional resources

Need help? Check the GitHub repository for issues, discussions, and updates.

Build docs developers (and LLMs) love