Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Set ANDROID_HOME instead of deprecated ANDROID_SDK_ROOT #1306

Merged
merged 3 commits into from
May 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions www/docs/en/dev/guide/platforms/android/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ In the Android Studio, open the **SDK Manager** (`Tools > SDK Manager`) and conf

- Android's **SDK Platform** for your targeted API Level
- **Android SDK Build-Tools** under the **SDK Tools** tab, for the targeted version.
- **Android SDK Command-line Tools (latest)** under the **SDK Tools** tab, for the latest version.

#### Android SDK Tools

Expand All @@ -108,14 +109,15 @@ Cordova's CLI requires specific environment variables so it can function correct
The following variables must be set:

- `JAVA_HOME` - The environment variable to the location of your JDK installation
- `ANDROID_SDK_ROOT` - The environment variable to the location of your Android SDK installation
- `ANDROID_HOME` - The environment variable to the location of your Android SDK installation

It is also recommended to update the `PATH` environment variable to include the following directories.

- `cmdline-tools/latest/bin`
- `emulator`
- `platform-tools`
- `build-tools`
- `tool/bin`
- `emulator`
- This is required for the `apksigner` and `zipalign` tools.

_**Note:** The directories above are generally located in the Android SDK ROOT._
Expand All @@ -127,15 +129,17 @@ On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` fi
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):

```bash
export ANDROID_SDK_ROOT=/Development/android-sdk/
export ANDROID_HOME=/Development/android-sdk/
```

To update your `PATH`, add a line resembling the following (substitute the paths with your local Android SDK installation's location):

```bash
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/
export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator/
export PATH=$PATH:$ANDROID_HOME/platform-tools/
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_HOME/tools/bin/
mosabab marked this conversation as resolved.
Show resolved Hide resolved
export PATH=$PATH:$ANDROID_HOME/build-tools
export PATH=$PATH:$ANDROID_HOME/emulator/
```

Reload your terminal to see this change reflected or run the following command:
Expand Down Expand Up @@ -174,7 +178,9 @@ Example paths (substitute the paths with your local Android SDK installation's l
```txt
C:\Users\[your user]\AppData\Local\Android\Sdk\platform-tools
C:\Users\[your user]\AppData\Local\Android\Sdk\cmdline-tools\latest\bin
C:\Users\[your user]\AppData\Local\Android\Sdk\tools\emulator
C:\Users\[your user]\AppData\Local\Android\Sdk\build-tools
C:\Users\[your user]\AppData\Local\Android\Sdk\tools\bin
mosabab marked this conversation as resolved.
Show resolved Hide resolved
C:\Users\[your user]\AppData\Local\Android\Sdk\emulator
```

Once all paths are added, click the **OK** button until all opened windows for setting & editing environment variables are closed.
Expand Down