React Native SDK Problems
This section covers common Android SDK-related problems that can prevent a React Native project from building or installing.
Problem 1 — SDK location not found
Example:
SDK location not found. Define a valid SDK location
with an ANDROID_HOME environment variable or by setting
the sdk.dir path in your project's local properties file.
This means Gradle cannot find the Android SDK.
Check the Android SDK location
On a typical Windows installation, the Android SDK is located at:
C:\Users<USERNAME>\AppData\Local\Android\Sdk
You can verify it from:
Android Studio → Settings → Languages & Frameworks → Android SDK
Solution A — Create local.properties
Inside your React Native project, open:
android/local.properties
If the file does not exist, create it. Add:
sdk.dir=C:/Users/Admin/AppData/Local/Android/Sdk
On Windows, using / instead of \ avoids many path-escaping problems.
Then clean the project:
cd android
gradlew clean
cd ..
Run React Native again:
npx react-native run-android
Problem 2 — Incorrect Windows path in local.properties
A common mistake is:
sdk.dir=C:\Users\<USERNAME>\AppData\Local\Android\Sdk
This can cause errors such as:
The filename, directory name, or volume label syntax is incorrect.
Use:
sdk.dir=C:/Users/Admin/AppData/Local/Android/Sdk
instead.
Alternatively, escape the backslashes:
sdk.dir=C:\\Users\\Admin\\AppData\\Local\\Android\\Sdk
The first format is generally simpler:
sdk.dir=C:/Users/Admin/AppData/Local/Android/Sdk
Problem 3 — Android SDK components are missing
Even if Gradle can find the SDK, the project may fail because required SDK components are not installed.
For example:
Failed to find Build Tools revision ...
or:
Failed to install the following Android SDK packages
Open: Android Studio → SDK Manager
Check that the required components are installed. Common components include:
- Android SDK Platform
- Android SDK Build-Tools
- Android SDK Platform-Tools
- Android SDK Command-line Tools
- Android SDK Tools required by the project
The exact Android API level and Build Tools version required depends on your React Native project's Gradle configuration.
After installing the required components, try:
npx react-native run-android
Problem 4 — Check whether ADB is installed correctly
ADB is included in Android SDK Platform-Tools.
Run:
adb version
Example:
Android Debug Bridge version 1.0.41
Version 36.0.0-13206524
Check where Windows is finding ADB:
where adb
Example:
C:\Users<USERNAME>\AppData\Local\Android\Sdk\platform-tools\adb.exe
If adb is not recognized, add the Android SDK platform-tools directory to your Windows PATH.
Typical path:
C:\Users<USERNAME>\AppData\Local\Android\Sdk\platform-tools
After changing PATH, open a new terminal and run:
adb version
Problem 5 — Check the Java version
React Native's Android build system also depends on Java.
Check the installed version:
java -version
For the environment used while creating this guide:
java version "17.0.18"
You can also check:
echo %JAVA_HOME%
If Gradle reports Java-related errors, verify that JAVA_HOME points to the intended JDK installation.
Do not blindly change Java versions just because a different version is mentioned online. Use the Java version supported by your specific React Native/Android Gradle Plugin setup.
Problem 6 — Clean the Android build
If the SDK configuration has been corrected but Gradle still behaves as if the old configuration is being used, clean the Android project:
cd android
gradlew clean
cd ..
Then run:
npx react-native run-android
If you use the Gradle wrapper directly from the Android directory, the command is:
gradlew clean
Problem 7 — react-native doctor
React Native provides a diagnostic command that can detect common development-environment problems.
Run:
npx react-native doctor
The doctor command can help identify problems with:
- Android SDK
- Android SDK tools
- JDK
- Android Studio
- Environment variables
- Connected Android devices
Follow the specific recommendations reported by the command rather than changing unrelated configuration.
Verify the Complete Android Environment
Before troubleshooting the React Native application itself, verify:
1. Java
java -version
2. ADB
adb version
3. Android SDK
Check android/local.properties and make sure it contains the correct SDK path:
sdk.dir=C:/Users/Admin/AppData/Local/Android/Sdk
4. Connected device
adb devices
Expected:
List of devices attached
PHONE_IP:5555 device
5. React Native environment
npx react-native doctor
Recommended Recovery Sequence
If the project suddenly starts reporting SDK-related errors:
cd android
gradlew clean
cd ..
Then verify:
java -version
adb version
adb devices
Check android/local.properties — make sure the SDK path is correct:
sdk.dir=C:/Users/Admin/AppData/Local/Android/Sdk
Then run:
npx react-native run-android
Important: Don't Confuse SDK Errors with ADB Errors
These are different problems.
SDK/build problem
Examples:
SDK location not found
Failed to find Build Tools
Could not determine the dependencies
Investigate: Android SDK / Gradle / Java / project configuration
ADB/device problem
Examples:
offline
cannot connect to PHONE_IP:5555
more than one device/emulator
Investigate: ADB / USB / Wi-Fi / connected devices
APK installation problem
Examples:
InstallException: EOF
Requested internal only, but not enough space
Investigate: Phone storage / APK installation / device communication
Most important rule: If Gradle successfully builds the APK and reaches installDebug, the Android SDK/build process has already progressed far enough. Read the installation error before changing SDK configuration.