diff --git a/AGENTS.md b/AGENTS.md index 5d6910e..4708b50 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,9 +53,28 @@ When the user provides an issue number to work on, the agent works in a dedicate ``` 4. `cd` into the worktree and continue all subsequent work there. Run `./gradlew`, tests, and the IDE from inside the worktree — never edit files in the main checkout. +5. **Resolve `local.properties` before any Gradle command.** It's gitignored, so a fresh worktree has no `sdk.dir` and `./gradlew` will fail to locate the Android SDK. Create `local.properties` at the worktree root with one line: + ```properties + sdk.dir=/absolute/path/to/Android/sdk + ``` + See [Finding the Android SDK path](#finding-the-android-sdk-path) below. If `local.properties` already exists in the worktree, leave it alone. Do not commit this file. If the worktree for that issue already exists (resuming work, or another agent on the same issue), `cd` into it and `git pull` — do not create a duplicate. +**Finding the Android SDK path** + +If you accepted Android Studio's default install location, the SDK lives at one of these: + +- **macOS:** `/Users//Library/Android/sdk` +- **Linux:** `/home//Android/Sdk` +- **Windows:** `C:\Users\\AppData\Local\Android\Sdk` + +To confirm the exact path on any machine, open Android Studio → Settings → Languages & Frameworks → Android SDK — the "Android SDK Location" field shows the absolute path. Alternatively, if `ANDROID_HOME` or `ANDROID_SDK_ROOT` is set in your shell environment, Gradle picks that up automatically and `local.properties` is not required. + +Notes on the file format: +- Use forward slashes and no quoting (even on Windows if you're on a Unix shell, or on macOS/Linux which is the project's platform). +- The path is per-machine, not per-project. Every worktree needs its own `local.properties` pointing at the local SDK. + **Conventions:** - Worktree path: `../ledgerr-` (sibling of the main checkout, not nested inside it)