Build & Troubleshoot
Execute project builds, resolve errors, and optimize Gradle configuration.
Commands
Execute based on the argument:
| Argument | Action |
|---|---|
debug / (none) | ./gradlew assembleDebug |
release | ./gradlew assembleRelease |
lint | ./gradlew lint for static analysis |
clean | ./gradlew clean assembleDebug |
check | ./gradlew check (tests + Lint combined) |
Build Error Resolution Flow
Step 1: Classify the Error
Read the error message and classify it:
Dependency Errors
- •Version conflicts → Unify in
libs.versions.toml - •Unresolved dependencies → Check Maven repositories
- •BOM version mismatches
Compilation Errors
- •Type mismatches, unresolved references
- •API changes in alpha/beta libraries
- •Kotlin version and Compose Compiler compatibility
Resource Errors
- •Undefined string/drawable resources
- •AndroidManifest configuration mistakes
Gradle Configuration Errors
- •Plugin version mismatches
- •
compileSdk/minSdk/targetSdksettings - •Java/Kotlin version mismatches
Step 2: Fix
- •Apply minimum changes to resolve
- •Manage dependency versions through
libs.versions.toml - •Rebuild to verify after fixing
Step 3: Address Lint Results
Address Lint warnings by severity:
- •Error: Must fix
- •Warning: Fix when possible
- •Info: Address as needed
Gradle Best Practices Check
Also verify the following during builds:
- •All versions are centrally managed in
libs.versions.toml - •No hardcoded versions in
build.gradle.kts - •No unused dependencies
- •
compileSdk,minSdk,targetSdkare appropriate - •ProGuard/R8 configuration is correct (for release builds)
Target
$ARGUMENTS