In this blog, you will learn how to get started with React Native, including how to download the package, install it and set up the environment. This is a great sneak peek into Eduonix’s upcoming React Native Course on Indiegogo.
Let’s get started with downloading and setting up React Native.
In order to install React Native, you will need Node.js, the React Native command line interface, and Android Studio.
We suggest that you install Node.js and Python2 via Chocolatey, a popular package manager similar to yum, then run the following command.
choco install nodejs.install choco install python2
You can find additional installation options on Node.js’s Downloads Page.
Node.js comes with npm, which lets you install the React Native command line interface.
1. Download and install Android Studio
Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps.
2. Install the AVD and HAXM
Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:
- Android SDK
- Android SDK Platform
- Performance (Intel HAXM)
- Android Virtual Device
Then, click “Next” to install all of these components.
3. Install the Android 6.0 (Marshmallow) SDK
Android Studio installs the most recent Android SDK by default. React Native, however, requires the Android 6.0 (Marshmallow) SDK. To install it, launch the SDK Manager, click on “Configure” in the “Welcome to Android Studio” screen.
The SDK Manager can also be found within the Android Studio “Preferences” menu, under Appearance & Behavior → System Settings → Android SDK. Select “SDK Platforms” from within the SDK Manager, then check the box next to “Show Package Details”. Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the
following items are all checked:
- Google APIs
- Intel x86 Atom System Image
- Intel x86 Atom_64 System Image
- Google APIs Intel x86 Atom_64 System Image
Next, select “SDK Tools” and check the box next to “Show Package Details” here as well. Look for and expand the “Android SDK Build Tools” entry, then make sure that Android SDK Build-Tools 23.0.1 is selected.
Finally, click “Apply” to download and install the Android SDK and related build tools.
4. Set up the ANDROID_HOME environment variable
The React Native command line interface requires the ANDROID_HOME environment variable to be set up.
Go to Control Panel → System and Security → System → Change settings → Advanced System Settings → Environment variables → New, then enter the path to your Android SDK.
Restart the Command Prompt to apply the new environment variable.
Please make sure you export the correct path for ANDROID_HOME, if you did not install the Android SDK using Android Studio.
If you want to learn more about React Native and also how to building brilliant applications with this amazing, you can help support Eduonix’s React Native course on Indiegogo!