DevOps | Cloud | Analytics | Open Source | Programming





How To Fix - Error "SDK location not found" in Android, React Native or Flutter ?



In this post, we will see How To Fix - Error "SDK location not found" in Android, React Native or Flutter. You can face this error while using Android, React Native, Flutter, Genymotion etc.


SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID\_HOME environment variable.

 

  • First thing first, check if you have Android SDK already installed. And find out Folder\directory location of the Android SDK. You can find the SDK location from your Android Studio --> File > Settings > Appearance & Behavior > System Settings > Android SDK
 

  • Normally the default location of Android SDK are -
    • Linux: ~/Android/Sdk
    • Mac: ~/Library/Android/sdk
    • Windows: %LOCALAPPDATA%\Android\sdk
 

  • So if Android SDK is not present ,make sure that you have installed Stable Android Studio version (Preferably the Latest Stable). At the Time of writing this post, the Latest Android Studio and corresponding Android Gradle plugin are as follows -
Android Studio Version

Android Gradle Plugin Version

Arctic Fox | 2020.3.1

3.1 or higher

Bumblebee | 2021.1.1

3.2 or higher

 

  • Assuming you have the Android Studio installed, you should have the Android SDK in the system now.
    • For Windows, it could be somewhere like depending on your installation and system -
      • /Users/USERNAME/Library/Android/sdk or
      • /Users/USERNAME/AppData/Local/Android/sdk
      • or some different dir for you
 

  • Make sure you have Gradle also setup. Note that it is mandatory to have Gradle and Android Gradle plugin setup before you proceed. Android and Gradle versions MUST be Compatible. If Gradle Plugin is not setup, you can check our other post, where we have explained in detail how to do it - How to Update or Upgrade Gradle version in Android Studio?
  At this point, we assume your Android Studio and Gradle is properly setup.  

Option 1:

We can fix the issue by using the below steps -

  • For this option, as a next step, We have to create a local.properties file so that we can point where the Android SDK is located. Hence Go to your React Native Project. And then Android. Create a file - local.properties .
 

  • Once you create the local.properties file, add the Android SDK details based on the operating system that you have.
    • For Windows

sdk.dir = C:\\\\Users\\\\<YOUR\_USERNAME>\\\\AppData\\\\Local\\\\Android\\\\sdk

    • For Linux

sdk.dir = /home/<YOUR\_USERNAME>/Android/Sdk

    • For Mac

sdk.dir = /Users/<YOUR\_USERNAME>/Library/Android/sdk

 

  • Make sure setting.gradle file present. The settings.gradle file, located in the root project directory, tells Gradle which modules it should include when building your app. This Settings.gradle just includes the module in your application. By default it will be 'app' module. If this file is not present, create the settings.gradle file and add the following.

    include ':app'
    
 

     

Option 2:

Add the Android details to your System Environment variables. For Windows -

    • Add the below variable to the Environment Variables list. Go to PC --> Properties -> Enviromnent variables --> Create New System variables. Variable name = ANDROID_HOME.
    • Set the below value to ANDROID_HOME

      C:\\Users\\YourUserName\\AppData\\Local\\Android\\Sdk

  For Linux - 

  • Open the ~/.bash_profile

touch ~/.bash\_profile; open ~/.bash\_profile

Or you can use other editors as well


mate ~/.bash\_profile
vim ~/.bash\_profile
nano ~/.bash\_profile

 

  • Add the below variables. Then Save and close the file.

export ANDROID\_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID\_HOME/emulator
export PATH=$PATH:$ANDROID\_HOME/tools
export PATH=$PATH:$ANDROID\_HOME/tools/bin
export PATH=$PATH:$ANDROID\_HOME/platform-tools

 

  • Reload and Make the changes to get reflected.

    source ~/.bash\_profile
    
OR


     . ~/.bash\_profile

 

  • Cross-check the changes.

echo $ANDROID\_HOME  
echo $PATH

  For Mac - 

  • Open the ~/.bash_profile

touch ~/.bash\_profile; open ~/.bash\_profile

Or you can use other editors as well


mate ~/.bash\_profile
vim ~/.bash\_profile
nano ~/.bash\_profile

  • Add the below variables. Then Save and close the file.

export ANDROID\_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID\_HOME/emulator
export PATH=$PATH:$ANDROID\_HOME/tools
export PATH=$PATH:$ANDROID\_HOME/tools/bin
export PATH=$PATH:$ANDROID\_HOME/platform-tools

  • Reload and Make the changes to get reflected.

    source ~/.bash\_profile
    
OR


     . ~/.bash\_profile

  • Cross-check the changes.

  echo $PATH

  Whether you followed Option 1 or Option 2, either ways after the Fix is applied as per the Steps, Do Restart the Android Studio. Hope this helps to fix the issue.  

Other Interesting Reads -

     


sdk location not found react native ,sdk location not found android studio ,sdk location not found. define location with an android\_sdk\_root environment variable ,sdk location not found mac ,sdk location not found flutter ,sdk location not found error in android studio ,sdk location not found jenkins ,sdk location not found android studio mac ,sdk location not found react-native mac ,sdk location not found. define location with an android\_sdk\_root environment ,sdk location not found flutter ,sdk location not found define location with sdk dir ,sdk location not found ubuntu ,a problem occurred configuring root project camera sdk location not found ,sdk location not found linux ,sdk location not found. define location with an android\_sdk\_root ,sdk location not found. define location with an android\_sdk\_root react native ,sdk location not found. define location with sdk.dir in the local.properties ,sdk location not found. define location with sdk.dir in the local.properties android , , ,android studio sdk location not found. define location with sdk.dir in the local.properties ,flutter sdk location not found. define location with sdk.dir in the local.properties ,sdk location not found local.properties , , ,SDK location not found. Define location with sdk.dir ,sdk location not found. define location with sdk.dir in the local.properties flutter ,sdk location not found. define location with sdk.dir in the local.properties react native ,sdk location not found. define location with sdk.dir in the local.properties android ,sdk location not found. define location with sdk.dir in the local.properties file or with an android ,sdk location not found. define location with sdk.dir in the local.properties ,sdk location not found. define location with an android\_sdk\_root ,flutter sdk location not found. define location with sdk.dir in the local.properties ,sdk location not found. define location with sdk.dir in the local.properties file ,sdk location not found. define location with sdk.dir in the local.properties or with an android\_home ,android studio sdk location not found. define location with sdk.dir in the local.properties , ,SDK location not found ,sdk location not found. define location with an android\_sdk\_root environment variable ,sdk location not found react native ,sdk location not found mac ,sdk location not found flutter ,sdk location not found error in android studio ,sdk location not found jenkins ,sdk location not found. define location with an android\_sdk\_root environment v ,sdk location not found. define location with an android\_sdk\_root environment variable or by setting ,sdk location not found android studio ,sdk location not found android\_sdk\_root ,android sdk location not found mac ,android sdk location not found visual studio 2019 ,android sdk location not found visual studio 2017 ,android sdk location not found eclipse ,jenkins android sdk location not found ,flutter android sdk location not found ,gradle build sdk location not found ,com.android.builder.errors.evalissueexception sdk location not found ,react native android build failed. sdk location not found ,sdk location not found ,sdk location not found android ,sdk location not found local.properties ,sdk location not found. define location with an android\_sdk\_root environment ,sdk location not found. define location with sdk.dir ,sdk location not found define location with android\_sdk\_root ,sdk location not found. define location with sdk.dir in the local.properties flutter ,sdk location not found. define location with sdk.dir in the local.properties react native ,sdk location not found. define location with sdk.dir in the local.properties android ,sdk location not found. define location with an android\_sdk\_root environment variable jenkins ,sdk location not found. define location with an android\_sdk\_root environment variable or ,sdk location not found error in react-native ,sdk location not found eclipse ,sdk location not found. define location with an android\_sdk\_root environment variable flutter ,file\_picker sdk location not found ,gradle sync failed sdk location not found ,sdk location not found gradle ,android gradle sdk location not found ,sdk location not found android\_home ,sdk location not found in android studio ,sdk location not found intellij ,sdk location not found in react native ,sdk location not found ionic ,flutter sdk not found in location ,flutter sdk not found in specified location ,dart sdk not found in specified location ,java.lang.runtimeexception sdk location not found ,kotlin sdk location not found ,sdk location not found linux ,sdk location not found react native mac ,android studio sdk location not found mac ,flutter sdk not found in specified location mac ,sdk location not found. define location with an android\_sdk\_root flutter ,sdk location not found. define location with sdk.dir in the local.properties ,android sdk not found at this location ,android sdk not found at this location flutter ,sdk location not found. define location with sdk.dir in the local.properties file or with an android ,sdk location not found ubuntu ,ubuntu android sdk location not found ,ubuntu android studio sdk location not found ,flutter sdk not found in specified location ubuntu ,sdk location not found windows ,android studio sdk location not found windows 10 ,react native sdk location not found windows ,sdk location not found. define location with an android\_sdk\_root environment variable react native ,sdk location not found. define location with an android\_sdk\_root environment variable android studio ,sdk location not found. define location with an android\_sdk\_root environment variable linux ,sdk location not found. define location with an android\_sdk\_root environment variable mac ,sdk location not found. define location with an android\_sdk\_root environment variable ubuntu ,react native android sdk location not found ,sdk location not found. define location with an android\_sdk\_root react native ,react-native-reanimated sdk location not found ,sdk location not found react native ubuntu ,sdk location not found. define location with an android\_sdk\_root environment mac ,react native sdk location not found mac ,sdk path not found ,sdk location not found macos ,sdk location not found android studio mac ,sdk location in mac ,sdk location not found. define location with an android\_sdk\_root mac ,flutter sdk not found in specified location android studio ,sdk not found flutter ,android sdk not found flutter ,flutter sdk location not found. define location with sdk.dir in the local.properties ,but android sdk not found at this location. flutter doctor ,flutter sdk is not found in the specified location android studio ,flutter sdk not found in specified location windows ,sdk folder not found in android studio ,sdk not found error in android studio ,sdk not found in android studio ,sdk location not found. android studio ,sdk folder missing in android studio ,sdk location not found. define location with sdk.dir in the local.properties file ,sdk location not found. define location with sdk.dir in the local.properties file or with an android ,sdk location not found. define location with sdk.dir in the local.properties flutter ,sdk location not found. define location with sdk.dir in the local.properties or with an android\_home ,sdk location not found. define location with sdk.dir in the local.properties react native ,a problem occurred configuring project ' app'. sdk location not found ,android gradle sdk location not found ,android sdk location not found ,android sdk location not found eclipse ,android sdk location not found mac ,android sdk location not found visual studio 2017 ,android sdk location not found visual studio 2019 ,android sdk location not found windows ,android sdk not found at this location ,android sdk not found at this location flutter ,android studio sdk location not found ,android studio sdk location not found mac ,android studio sdk location not found windows 10 ,android\_home = /library/android/sdk but android sdk not found at this location ,android\_home = /opt/android-sdk but android sdk not found at this location ,android\_home = /usr/local/share/android-sdk but android sdk not found at this location ,android\_home but android sdk not found at this location ,but android sdk not found at this location ,but android sdk not found at this location. flutter doctor ,com.android.builder.errors.evalissueexception sdk location not found ,dart sdk is not found in the specified location ,dart sdk is not found in the specified location mac ,dart sdk not found in specified location ,eclipse android sdk location not found ,err\_sdk\_package \_not\_found sdk package not found by location ,error dart sdk is not found in the specified location ,error flutter sdk is not found in the specified location ,error flutter sdk not found. define location with flutter.sdk in the local.properties file ,error sdk location not found ,file\_picker sdk location not found ,flutter android sdk location not found ,flutter sdk is not found in the specified location ,flutter sdk is not found in the specified location hatası ,flutter sdk is not found in the specified location mac ,flutter sdk is not found in the specified location ne demek ,flutter sdk is not found in the specified location ubuntu ,flutter sdk is not found in the specified location windows ,flutter sdk location not found ,flutter sdk location not found. define location with an android\_sdk\_root ,flutter sdk location not found. define location with an android\_sdk\_root environment variable ,flutter sdk not found in location ,flutter sdk not found in specified location ,flutter sdk not found in specified location mac ,flutter sdk not found in specified location ubuntu ,flutter sdk not found. define location with flutter.sdk in the local.properties file ,genymotion android sdk not found at this location ,gradle build sdk location not found ,gradle sdk location not found ,gradle sync failed sdk location not found ,intellij sdk location not found ,ionic sdk location not found ,java.lang.runtimeexception sdk location not found ,jenkins android sdk location not found ,jenkins sdk location not found. define location with an android\_sdk\_root environment ,jenkins sdk location not found. define location with an android\_sdk\_root environment variable ,kotlin sdk location not found ,linux sdk location not found ,linux sdk location not found. define location with an android\_sdk\_root environment variable ,mac android studio sdk location not found ,mac sdk location not found ,mac sdk location not found. define location with an android\_sdk\_root environment variable ,put location of the sdk (default /root/android/sdk) directory not found ,react native android build failed. sdk location not found ,react native android sdk location not found ,react native sdk location not found ,react native sdk location not found windows ,react-native run-android sdk location not found ,sdk location not found ,sdk location not found android studio ,sdk location not found android\_home ,sdk location not found android\_sdk\_root ,sdk location not found define location with android\_sdk\_root ,sdk location not found eclipse ,sdk location not found error in android studio ,sdk location not found error in react-native ,sdk location not found flutter ,sdk location not found gradle ,sdk location not found in android studio ,sdk location not found in react native ,sdk location not found intellij ,sdk location not found ionic ,sdk location not found jenkins ,sdk location not found linux ,sdk location not found local.properties ,sdk location not found mac ,sdk location not found on mac ,sdk location not found qt ,sdk location not found query ,sdk location not found react native ,sdk location not found react native mac ,sdk location not found ubuntu ,sdk location not found windows ,sdk location not found xampp ,sdk location not found xcode ,sdk location not found xiaomi ,sdk location not found xml ,sdk location not found zerodha ,sdk location not found zip ,sdk location not found zip file ,sdk location not found zoho crm ,sdk location not found zoom ,sdk location not found. define location ,sdk location not found. define location with an android\_sdk\_root environment mac ,sdk location not found. define location with an android\_sdk\_root environment v ,sdk location not found. define location with an android\_sdk\_root environment varia ,sdk location not found. define location with an android\_sdk\_root environment variable ,sdk location not found. define location with an android\_sdk\_root environment variable flutter ,sdk location not found. define location with an android\_sdk\_root environment variable jenkins ,sdk location not found. define location with an android\_sdk\_root environment variable mac ,sdk location not found. define location with an android\_sdk\_root environment variable or ,sdk location not found. define location with an android\_sdk\_root environment variable or by ,sdk location not found. define location with an android\_sdk\_root environment variable or by setting ,sdk location not found. define location with an android\_sdk\_root environment variable ubuntu ,sdk location not found. define location with an android\_sdk\_root flutter ,sdk location not found. define location with sdk.dir in the local.properties ,sdk location not found. define location with sdk.dir in the local.properties android ,sdk location not found. define location with sdk.dir in the local.properties file ,sdk location not found. define location with sdk.dir in the local.properties file or with an android ,sdk location not found. define location with sdk.dir in the local.properties flutter ,sdk location not found. define location with sdk.dir in the local.properties or with an android\_home ,sdk location not found. define location with sdk.dir in the local.properties react native ,ubuntu android sdk location not found ,ubuntu android studio sdk location not found ,ubuntu sdk location not found ,ubuntu sdk location not found. define location with an android\_sdk\_root environment variable ,visual studio android sdk location not found ,where is sdk location in android studio