How to prepare your Windows box for Ionic 3 development

The guide assumes the OS of your machine is Windows 10.

INSTALL NODEJS

Download and install the latest LTS NodeJS from the following link:

Note: At the time this guide was written, the latest LTS version of NodeJS was 8.10.0.

INSTALL CLIS

To install the global dependencies open the Command Prompt (cmd) and run:

$ npm install -g ionic cordova

Note: This command will install the latest version of Ionic and Cordova. At the time this guide was written, the latest version of Ionic was 3.20.0 and Cordova was 7.1.0.

SDK ENVIRONMENT FOR ANDROID PLATFORM

To be ready to add and build the Android platform, follow the steps below.

INSTALL JAVA SE DEVELOPMENT KIT 8 (JDK)

Visit Oracle’s website and install Java SE Development Kit 8.

INSTALL ANDROID STUDIO 3.X

Visit Android Studio page and install Android Studio 3.x.

INSTALL SDK PLATFORMS

After installing the Android SDK, you must also install the packages for whatever API level you wish to target. To do it, open the Android Studio, and click on Configure -> SDK Manager.

Then, from the side menu, select Appearance & Behavior -> System Settings -> Android SDK click on the SDK Platforms tab and select one or more versions of APIs to download, as shown:

INSTALL ANDROID SUPPORT REPOSITORY

Usually, Android Support Repository is already configured once you install Android Studio. If it’s not, go to the SDK Tools tab select to install the Android Support Repository.

INSTALL GRADLE

Sometimes, you may need to install gradle manually. Install Gradle as directed at:

Note: Following the instructions of the aforementioned link, the latest Gradle distribution will be installed on your machine. At the time this guide was written, the installed Gradle version was 4.5.1.
For more information on the Android requirements, visit

SET ENVIRONMENT VARIABLES

Cordova's CLI tools require some environment variables to be set in order to function correctly. In most cases, they will be set automatically but, in certain cases you may need to set them manually.
Type advanced system settings in the Search the web and Windows box and select View advanced system settings under the Best Match.

From the appeared window select Advanced tab and click Environment variables.

SET JAVA_HOME

Next, set the JAVA_HOME environment variable to the location of your JDK installation. From the appeared window click New… and set the Variable Name to JAVA_HOME and the Variable value to the location of the installed Java JDK.

UPDATE PATH

From System Variables select Path and press Edit…

In the next window, press New and set the location to the PATH as %JAVA_HOME%\bin

SET ANDROID_HOME

Finally, set the ANDROID_HOME environment variable to the location of your Android SDK installation. To do this, click New… and set the Variable Name to ANDROID_HOME and the Variable value to the location of the installed Java JDK.

SASS

To install Sass open your terminal and execute the following command:

$ npm install -g sass

For more information visit Sass site.

REFERENCES

Android Studio installation guide, Cordova Android Platform Guide, Gradle installation docs

Stay tuned

Join our list and sing up to get early access to our latest news and free tutorials about Ionic.