---
id: "60"
title: "init_kotlin_app no genera local.properties"
status: completado
type: feature
domain: []
scope: app-scoped
priority: alta
depends: []
blocks: []
related: []
created: 2026-05-10
updated: 2026-05-17
tags: []
---

## Sintoma

Tras scaffoldear, gradle aborta con:
```
SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '<dir>/local.properties'.
```

## Causa

Scaffolder no genera `local.properties`. Aunque `gradle_run_bash_infra` exporta ANDROID_HOME, IDEs (Android Studio) y devs que usen `gradle` directamente no heredan ese env.

## Fix propuesto

En `init_kotlin_app.sh` tras crear estructura, generar:

```bash
cat > "$abs_dir/local.properties" <<EOF
# Auto-generated by init_kotlin_app. Per-machine, gitignore'd.
sdk.dir=${ANDROID_SDK_DIR:-$HOME/android-sdk}
EOF
```

Y anadir `local.properties` al `.gitignore` del scaffold.

## Validacion

`fn run init_kotlin_app smoke && cd apps/smoke && ./gradlew tasks` debe ejecutar sin error de SDK location.
