SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
Please follow below steps it work's for me:
- Go to your react-native Project then go to android directory
Create a file with following name:
local.properties
- Open the file and paste your Android SDK path like below:
For windows users:
sdk.dir=C:\\Users\\UserName\\AppData\\Local\\Android\\sdk
Replace UserName with your pc user name . Also make sure the folder is sdk or Sdk. In my case my computer user name is Zahid so the path look like:
sdk.dir=C:\\Users\\Zahid\\AppData\\Local\\Android\\sdk
For Mac users:
sdk.dir = /Users/USERNAME/Library/Android/sdk
Where USERNAME is your OSX username.
For Linux (Ubuntu) users:
sdk.dir = /home/USERNAME/Android/Sdk
Where USERNAME is your linux username(Linux paths are case-sensitive: make sure the case of S
in Sdk
matches)
In case if this doesn't work, add ANDROID_HOME variable in "Environment Variables" as C:\Users\USER\AppData\Local\Android\Sdk
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
Please follow below steps it work's for me:
- Go to your react-native Project then go to android directory
Create a file with following name:
local.properties
- Open the file and paste your Android SDK path like below:
For windows users:
sdk.dir=C:\\Users\\UserName\\AppData\\Local\\Android\\sdk
Replace UserName with your pc user name . Also make sure the folder is sdk or Sdk. In my case my computer user name is Zahid so the path look like:
sdk.dir=C:\\Users\\Zahid\\AppData\\Local\\Android\\sdk
For Mac users:
sdk.dir = /Users/USERNAME/Library/Android/sdk
Where USERNAME is your OSX username.
For Linux (Ubuntu) users:
sdk.dir = /home/USERNAME/Android/Sdk
Where USERNAME is your linux username(Linux paths are case-sensitive: make sure the case of S
in Sdk
matches)
In case if this doesn't work, add ANDROID_HOME variable in "Environment Variables" as C:\Users\USER\AppData\Local\Android\Sdk
SDK Location not found in android studio
You should also change it on Project Structure.
Close the current project and you'll see pop up with dialog which will then proceed to Configure option.
Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local.properties and select Valid Target.
There you go.
Related Topics
How to Keep a Bottom Nav Bar from Being Pushed Up on Keyboard Shown
Install Apps Silently, With Granted Install_Packages Permission
How to Make My App Work in All Devices
Retrofit 2 Json Response Json Array and Object
Socket.Io Client Getting Connected Disconnected Repeatedly
How to Clear Navigation Stack After Navigating to Another Fragment in Android
Get Height and Width of a Layout Programmatically
Keep Screen Alive and App in Front of Lockscreen
Html File Input in Android Webview (Android 4.4, Kitkat)
Android Button Background Is Taking the Primary Color
Check If an Email Exists Before Creating a User Firebase Android
How to Check Miui Autostart Permission Programmatically
How to Fix White Screen on App Start Up
Android - How to Make a Button Click Play a Sound File Every Time It Been Pressed
How to Start Android Application on Device Boot
Super.Onbackpressed() and Finish() Exits the App
Access Denied Finding Property "Camera.Hal1.Packagelist"
How to Make Image Fill Relativelayout Background Without Stretching