Setting up a React Native development environment for Android can feel overwhelming at first — especially if you’re new to Android Studio, SDK tools, and environment variables.
In this guide, I’ll walk you through the exact process I followed to successfully set up my environment on Windows. By the end, you’ll be able to:
- Run your React Native project on an Android emulator
- Build your app locally
- Avoid common JDK, SDK, and NDK issues
- Launch your app smoothly using
npx react-native run-android
This setup is ideal for long-term development and future-proofing your workflow.
Why Proper Environment Setup Is Important
React Native development for Android requires multiple tools working together:
- Node.js
- React Native CLI
- Java Development Kit (JDK)
- Android Studio
- Android SDK
- Android Emulator
If even one component is misconfigured, you may face:
- CMake build errors
- Device detection issues
- Gradle failures
- Emulator launch problems
So let’s set everything up properly from scratch.
Step 1: Install Node.js (LTS Recommended)
React Native depends on Node.js.
Recommended Method (Windows)
Use Chocolatey package manager.
Open Command Prompt as Administrator and run:
choco install -y nodejs-lts microsoft-openjdk17
Important Notes
- Use an LTS version of Node.
- Node 22.11.0 or newer is recommended.
- If you want multiple Node versions, use
nvm-windows.
Verify installation:
node -v
npm -v
Step 2: Install Java Development Kit (JDK 17)
React Native works most reliably with JDK 17.
Even if you have a newer JDK installed, I strongly recommend using JDK 17 to avoid Gradle compatibility issues.
Verify:
java -version
It should show something like:
openjdk version "17.x.x"
Step 3: Install Android Studio
Download and install Android Studio.
During installation, make sure these are selected:
- Android SDK
- Android SDK Platform
- Android Virtual Device
- Performance (Intel HAXM if not using Hyper-V)
After installation completes, proceed to SDK configuration.
Step 4: Install Required Android SDK Components
Open Android Studio → More Actions → SDK Manager.
In SDK Platforms Tab
- Enable “Show Package Details”.
- Expand Android 15 (VanillaIceCream).
- Select:
- Android SDK Platform 35
- Intel x86 Atom_64 System Image or Google APIs System Image
In SDK Tools Tab
- Enable “Show Package Details”.
- Select:
- Android SDK Build-Tools 36.0.0
- Android SDK Command-line Tools (latest)
- NDK (Side by side)
- CMake
Click Apply and install.
Step 5: Set ANDROID_HOME Environment Variable
React Native requires Android environment variables.
How to Set It (Windows)
- Open Control Panel
- Go to User Accounts → Environment Variables
- Click New
Create:
Variable Name: ANDROID_HOME
Variable Value: %LOCALAPPDATA%\Android\Sdk
Open a new Command Prompt and verify:
Get-ChildItem -Path Env:\
Make sure ANDROID_HOME appears.
Step 6: Add platform-tools to PATH
Still in Environment Variables:
- Edit the Path variable
- Add:
%LOCALAPPDATA%\Android\Sdk\platform-tools
Verify:
adb --version
adb devices
Step 7: Create and Launch an Android Virtual Device (AVD)
Open Android Studio → AVD Manager.
- Click Create Virtual Device
- Select a phone model
- Choose API Level 35 (VanillaIceCream)
- Finish setup
Click the green ▶ button to launch the emulator.
Step 8: Verify Device Connection
Once emulator is running:
adb devices
You should see:
emulator-5554 device
If not, restart ADB:
adb kill-server
adb start-server
adb devices
Step 9: Create and Run React Native Project
Create project:
npx react-native init MyApp
Navigate into project:
cd MyApp
Run Android app:
npx react-native run-android
If multiple devices are connected:
npx react-native run-android --device emulator-5554
Important Compatibility Notes (Very Important)
During my setup, I faced the following real issues:
1. Gradle Using Wrong Java Version
Fix: Force JDK 17 in android/gradle.properties
2. CMake Error: std::format Not Found
Cause: Using NDK 26
Fix: Install and use NDK 27.1.12297006
Add inside android {} in build.gradle:
ndkVersion "27.1.12297006"
Then clean:
cd android
gradlew clean
This resolved C++ build errors completely.
Final Working Configuration Summary
For a stable React Native Android setup on Windows:
- Node: LTS (22+ recommended)
- Java: JDK 17
- Android SDK Platform: 35
- Build Tools: 36.0.0
- NDK: 27.1.12297006
- Emulator: API 35
- Correct ANDROID_HOME + PATH
Conclusion
Setting up React Native Android development correctly takes time — but once done properly, everything runs smoothly.
By following this guide:
- Emulator launches correctly
- ADB detects devices
- Gradle builds without errors
- Native C++ compilation works
- App runs smoothly using
run-android
If you’re setting this up for the first time, expect about an hour. After that, development becomes fast and seamless.
This guide will help you avoid common mistakes and future build headaches.