Skip to main content

Prerequisites

Before building the TecMeli app, ensure you have:
  • Android Studio Ladybug or later
  • JDK 11 or higher
  • Android SDK with API level 36
  • Gradle 8.0+ (included via Gradle Wrapper)

Build Configuration

The project uses Gradle with Kotlin DSL for build configuration. The main configuration files are:
plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.compose)
    alias(libs.plugins.hilt)
    alias(libs.plugins.ksp)
    kotlin("plugin.serialization") version "2.0.21"
    jacoco
}

android {
    namespace = "com.alcalist.tecmeli"
    compileSdk = 36

    defaultConfig {
        applicationId = "com.alcalist.tecmeli"
        minSdk = 26
        targetSdk = 36
        versionCode = 1
        versionName = "1.0"
    }
}

Environment Configuration

1

Create local.properties

Create a local.properties file in the project root (this file is gitignored):
sdk.dir=/path/to/Android/sdk
MELI_CLIENT_ID=your_client_id
MELI_CLIENT_SECRET=your_client_secret
MELI_REFRESH_TOKEN=your_refresh_token
2

Configure API Credentials

The build system will inject these credentials as BuildConfig fields:
buildConfigField("String", "CLIENT_ID", "\"${project.findProperty("MELI_CLIENT_ID") ?: ""}\"")
buildConfigField("String", "CLIENT_SECRET", "\"${project.findProperty("MELI_CLIENT_SECRET") ?: ""}\"")
buildConfigField("String", "REFRESH_TOKEN", "\"${project.findProperty("MELI_REFRESH_TOKEN") ?: ""}\"")
Never commit local.properties to version control as it contains sensitive API credentials.

Building the App

Using Android Studio

1

Sync Project

Open the project in Android Studio and sync Gradle files:File → Sync Project with Gradle Files
2

Build the App

Select a build variant (Debug/Release) and build:Build → Make Project or press Ctrl+F9 (Windows/Linux) / Cmd+F9 (Mac)
3

Run on Device

Connect a device or start an emulator, then:Run → Run ‘app’ or press Shift+F10 (Windows/Linux) / Ctrl+R (Mac)

Using Command Line

# Build debug APK
./gradlew assembleDebug

# Output: app/build/outputs/apk/debug/app-debug.apk

Build Variants

The project supports standard Android build types:
Build TypeMinificationDebuggingProGuard
DebugDisabledEnabledNo
ReleaseDisabledDisabledYes
buildTypes {
    release {
        isMinifyEnabled = false
        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
}
Minification is currently disabled in release builds. Enable it by setting isMinifyEnabled = true for production releases.

Compilation Options

The project uses Java 11 compatibility:
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}
Enabled Build Features:
  • Jetpack Compose - Modern declarative UI toolkit
  • BuildConfig - Access to build-time configuration values

Dependency Management

The project uses version catalogs for centralized dependency management. All dependencies are defined in gradle/libs.versions.toml:
androidx-core-ktx = "1.17.0"
androidx-lifecycle-runtime-ktx = "2.10.0"
androidx-activity-compose = "1.12.4"
composeBom = "2026.02.01"
# Includes: ui, ui-graphics, ui-tooling-preview, material3
hilt = "2.59.2"
# Includes: hilt-android, hilt-compiler, hilt-navigation-compose
retrofit = "3.0.0"
okhttp = "4.11.0"
# Includes: retrofit, converter-gson, okhttp, logging-interceptor
junit = "4.13.2"
mockk = "1.13.8"
mockwebserver = "4.11.0"
kotlinx-coroutines-test = "1.7.3"

Common Build Issues

Solution: Create local.properties with your Android SDK path:
sdk.dir=/path/to/Android/sdk
Or set the ANDROID_HOME environment variable.
Solution: Clean and rebuild the project:
./gradlew clean build
Ensure @HiltAndroidApp is present in your Application class.
Solution: Verify that Kotlin and Compose compiler versions are compatible. The project uses:
  • Kotlin: 2.3.10
  • Compose Plugin: kotlin.plugin.compose
Solution: Add Mercado Libre credentials to local.properties:
MELI_CLIENT_ID=your_client_id
MELI_CLIENT_SECRET=your_client_secret
MELI_REFRESH_TOKEN=your_refresh_token

Build Output

After a successful build, you’ll find the following artifacts:
app/build/
├── outputs/
│   ├── apk/
│   │   ├── debug/
│   │   │   └── app-debug.apk
│   │   └── release/
│   │       └── app-release.apk
│   └── logs/
├── intermediates/
├── generated/
│   └── ksp/          # Hilt generated code
└── tmp/
For faster incremental builds, enable Gradle build cache in gradle.properties:
org.gradle.caching=true

Next Steps

Testing

Learn how to run tests and generate coverage reports

Contributing

Read the contribution guidelines

Build docs developers (and LLMs) love