You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/setup/windows.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,7 @@ You may need to restart your terminal for changes to apply.
99
99
[Download and install Android Studio](https://developer.android.com/studio). In the installation wizard make sure you have the following components selected (the list should appear if you select **custom** options):
100
100
101
101
- Android SDK
102
+
- Android SDK Build-Tools
102
103
- Android SDK Platform
103
104
- Android Virtual Device
104
105
- Performance (Intel ® HAXM) — optional, learn more about [AMD Processor & Hyper-V support](https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html)
@@ -107,6 +108,15 @@ The setup may take a while, but once it has finished a welcome screen should app
107
108
108
109
Android Studio installs the latest Android SDK by default, which in most cases should be all that's needed to build a NativeScript app.
109
110
111
+
After Android Studio finishes installing, open **Settings > Languages & Frameworks > Android SDK** and confirm the SDK path shown there matches the path you will use for `ANDROID_HOME`.
112
+
113
+
Then verify the following components are installed:
114
+
115
+
- Under **SDK Platforms**: at least one recent Android SDK Platform
116
+
- Under **SDK Tools**: **Android SDK Build-Tools** and **Android SDK Platform-Tools**
117
+
118
+
If `ns doctor android` later reports that no compatible Android SDK Build-Tools are installed, return to this screen and install a recent Build-Tools version.
119
+
110
120
### Configuring `ANDROID_HOME` and `PATH`
111
121
112
122
Configure the `ANDROID_HOME` environment variable for NativeScript to be able to find the Android SDK.
@@ -156,6 +166,25 @@ ns doctor android
156
166
157
167
If you see **No issues were detected** then you have successfully set up your system.
158
168
169
+
If not, verify the values NativeScript will resolve from your shell:
170
+
171
+
```bat
172
+
echo %JAVA_HOME%
173
+
javac --version
174
+
where javac
175
+
echo %ANDROID_HOME%
176
+
where adb
177
+
dir "%ANDROID_HOME%\build-tools"
178
+
```
179
+
180
+
Expected results:
181
+
182
+
-`javac --version` prints a Java version
183
+
-`where javac` points to your JDK `bin` folder
184
+
-`echo %ANDROID_HOME%` prints the Android SDK path configured in Android Studio
185
+
-`where adb` points to `%ANDROID_HOME%\platform-tools\adb.exe`
186
+
-`dir "%ANDROID_HOME%\build-tools"` shows one or more installed Build-Tools versions
187
+
159
188
If you're using Chocolatey and prefer not to open a new terminal, you can refresh your environment variables in the current PowerShell session by running:
160
189
161
190
```bash
@@ -166,10 +195,24 @@ Update-SessionEnvironment
166
195
After refreshing, run the `ns doctor` command again to confirm everything is working as expected.
167
196
168
197
198
+
::: tip Common issues on Windows
199
+
200
+
If you installed Chocolatey, the JDK, or Android Studio after opening your terminal or VS Code, close all existing terminal windows and open a new one before running `ns doctor android` again. In some cases you may also need to fully restart VS Code.
201
+
202
+
If Android Studio uses a custom SDK location, make sure `ANDROID_HOME` points to that exact location instead of the default `%LOCALAPPDATA%\Android\Sdk` path.
203
+
204
+
:::
205
+
169
206
Lastly, you will also want to [set up an android device](/guide/running#enable-usb-debugging-on-android-devices) or [emulator](/guide/running#android-emulators).
170
207
171
208
::: warning Troubleshooting
172
209
210
+
If `ns doctor android` reports **No compatible version of the Android SDK Build-tools are installed on your system**, open Android Studio and go to **Settings > Languages & Frameworks > Android SDK > SDK Tools**, then install or update **Android SDK Build-Tools**.
211
+
212
+
If `ns doctor android` reports **Error executing command `javac`**, verify both `JAVA_HOME` and your `Path` are configured correctly, then confirm `javac --version` works in a new terminal window.
213
+
214
+
If `ANDROID_HOME` seems correct but NativeScript still cannot find the SDK, verify the path from `echo %ANDROID_HOME%` matches the Android Studio SDK location exactly and that `platform-tools` and `build-tools` exist inside that folder.
215
+
173
216
If any of the above failed, we recommend asking in [our Community Discord](https://nativescript.org/discord) for assistance.
0 commit comments