---
id: 0074
title: init_kotlin_app no genera local.properties
status: pending
priority: high
created: 2026-05-10
related_pipelines: [init_kotlin_app_bash_pipelines]
related_apps: [counter_kt]
---

## 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.
