Skip to content

Commit 0a42661

Browse files
InfantLabclaude
andcommitted
docs(android): warn about cmdline-tools double-nesting + force fresh shell
The "extract to cmdline-tools/latest/" instruction was too easy to misread as "drag the cmdline-tools folder into latest/", which produces a doubly-nested cmdline-tools/latest/cmdline-tools/bin/ that sdkmanager can't find from PATH. Adds the exact target layout, a fix-in-place snippet for people who already hit it, and a "close every Powershell" nudge so env vars are actually live. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 90fbadb commit 0a42661

1 file changed

Lines changed: 33 additions & 6 deletions

File tree

docs/dev/android-build-handover.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,43 @@ java -version # should show "openjdk version 17.x.x"
5656
### Install Android command-line tools
5757

5858
1. Download from `https://developer.android.com/studio#command-line-tools-only` — the "Command line tools only" zip (Windows).
59-
2. Extract to `C:\android-sdk\cmdline-tools\latest\` (note: the `latest` folder is required by Google's installer paths).
59+
2. Extract somewhere temporary first — the zip contains a single `cmdline-tools/` folder. You need to end up with this **exact** layout (Google's hard-coded convention):
60+
61+
```
62+
C:\android-sdk\
63+
cmdline-tools\
64+
latest\
65+
bin\
66+
sdkmanager.bat
67+
avdmanager.bat
68+
lib\
69+
NOTICE.txt
70+
source.properties
71+
```
72+
73+
The most common mistake is dragging the whole `cmdline-tools/` folder into `latest/`, which gives you `C:\android-sdk\cmdline-tools\latest\cmdline-tools\bin\...` — one level too deep. `sdkmanager.bat` must be at `cmdline-tools\latest\bin\sdkmanager.bat` exactly.
74+
75+
If you've already done that, fix in place:
76+
```powershell
77+
Move-Item C:\android-sdk\cmdline-tools\latest\cmdline-tools\* C:\android-sdk\cmdline-tools\latest\
78+
Remove-Item C:\android-sdk\cmdline-tools\latest\cmdline-tools
79+
```
80+
6081
3. Set environment variables (System Properties → Environment Variables):
6182
- `ANDROID_HOME` = `C:\android-sdk`
6283
- Add to `PATH`: `%ANDROID_HOME%\cmdline-tools\latest\bin`, `%ANDROID_HOME%\platform-tools`
63-
4. Open a new Powershell, install the SDK pieces we need:
84+
4. **Close every Powershell window and open a fresh one** so the new env vars are picked up. Then verify:
6485

65-
```powershell
66-
sdkmanager --licenses # accept all
67-
sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
68-
```
86+
```powershell
87+
where.exe sdkmanager.bat # should print C:\android-sdk\cmdline-tools\latest\bin\sdkmanager.bat
88+
```
89+
90+
5. Install the SDK pieces we need:
91+
92+
```powershell
93+
sdkmanager --licenses # accept all
94+
sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
95+
```
6996

7097
That's the entire native toolchain. ~1GB total.
7198

0 commit comments

Comments
 (0)