- How to Fix “SDK location not found” in Android Studio?
- When switching from one IDE to another (Like from Eclipse to Android Studio)
- X Unable to locate Android SDK. #13078
- Comments
- sjx19900424 commented Nov 18, 2017
- bledfort commented Feb 24, 2018
- sam43 commented Feb 27, 2018
- DevXtreme0 commented Feb 27, 2018 •
- sam43 commented Feb 28, 2018
- sam43 commented Feb 28, 2018 •
- AbderrahmeneDZ commented May 15, 2018 •
- sumiaggarwal commented May 27, 2018
- zoechi commented Aug 3, 2018
- mahbobyosf commented Aug 28, 2018
- arsalan0312 commented Sep 5, 2018
- zoechi commented Sep 5, 2018
- zoechi commented Oct 8, 2018
- JosephDunivan commented Dec 5, 2018
- JosephDunivan commented Dec 5, 2018 •
- QuietLakeStone commented Dec 15, 2018
- DevLuuk commented Jan 8, 2019 •
- Qinxianshen commented Jan 30, 2019
- ValmirJuniorr commented Mar 20, 2019
- codingcity4747 commented Mar 20, 2019
- DaywisonSilva commented Sep 5, 2019
- avavirus3 commented Mar 18, 2020 •
- How to Fix Error “Unable to Locate ADB” on Android Studio?
- Restore ADB From Third-Party Antivirus
- Change Project Settings
- Install Android SDK from SDK Manager
- Reinstall Platform Tools
How to Fix “SDK location not found” in Android Studio?
Google developed Android SDK which is a Software Development Kit developed by Google for the Android platform. You can create Android apps using Android SDK, and you don’t need to be an expert to use it. Android SDK and Android Studio come bundled together, with Google’s official integrated development environment (IDE) for the Android operating system.
In this article, we see how to fix an error that is related to the main Android building component of Android Studio that is the Android SDK. The most common error related to Android SDK is “SDK location not found“. This message pops up stating that the location of Android SDK was not detected when the path of SDK is assigned incorrectly. There can also be other reasons for this error message as well and we will see ways to get rid of this error.
When switching from one IDE to another (Like from Eclipse to Android Studio)
Method 1
In this case, follow the below steps:
Method 2
In case the above procedure doesn’t work then add the ANDROID_HOME variable in “Environment Variables” as C:\Users\Username\AppData\Local\Android\Sdk.
Method 3
In case it does not work even then, then you need to change the directory path on Project Structure as well.
- Close the current project and you’ll see a pop-up with a 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.
Method 4
A settings.gradle file might be missing from the project. Make sure that the file exists from the project you are importing. If not add the settings.gradle file with the following:
Save the file and put it in the top-level folder in your project.
Источник
X Unable to locate Android SDK. #13078
Comments
sjx19900424 commented Nov 18, 2017
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
I have installed Android SDK ,and set $ANDROID_HOME. But ‘flutter doctor’ show the error again.
The text was updated successfully, but these errors were encountered:
bledfort commented Feb 24, 2018
Same issue, why there is no responses? weird
sam43 commented Feb 27, 2018
same issue. stucked. Help!
DevXtreme0 commented Feb 27, 2018 •
try to Install Android studio again, with default installation folder. OR now I found a way to solve this problem .. this is the way i solved this issue:
(Reminder — before doing below steps make sure you already setup environment variable for flutter doctor like , variable name as «Path » variable value as «flutter\bin;» )
1st go to Control Panel -> click User Accounts -> again click User Account -> you can see option called «change my environment variables» click it -> in popup small window click NEW and type variable name as ANDROID_HOME variable value as «your Android SDK Location » Example : «Partition Letter:\AndroidStudioSDK» , Save this settings.
After that go to the windows power shell type flutter doctor and click enter, you can see some results.
sam43 commented Feb 28, 2018
Wow, this worked perfectly, thank you. but I can’t able start any device to run the sample project. Can you help me with this last thing please? here is the attachment.
@PillowDeveloper
sam43 commented Feb 28, 2018 •
Update. working fine. But have to start the project from PowerShell and run it. Note: Close your AS 3.0 if it is running. steps: create app -> cd -> flutter run. Boom! Happy coding. 🙂
AbderrahmeneDZ commented May 15, 2018 •
I had the same problem,
I did the following steps :
*/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor
this should work on windows
sumiaggarwal commented May 27, 2018
thanks worked like a charm 🙂
zoechi commented Aug 3, 2018
@sjx19900424 is this still an issue or can this be closed?
mahbobyosf commented Aug 28, 2018
This worked perfectly, thank you.
arsalan0312 commented Sep 5, 2018
I have the same issue after following step.
/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor
zoechi commented Sep 5, 2018
check the SDK config in android/local.properties
You can use flutter config to update it.
Can you still reproduce when the setting is updated to the new path?
zoechi commented Oct 8, 2018
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don’t hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
JosephDunivan commented Dec 5, 2018
check the SDK config in android/local.properties
You can use flutter config to update it.
Can you still reproduce when the setting is updated to the new path?
@zoechi When you say «You can use flutter config to update it.» can you elaborate? The issue is flutter expects the path to point to /usr/local/share/android-sdk, however android studio installs everything in users//library/android/sdk and has for quite some time. The issue seems to be that redirecting this expected path to the actual path in .bash_profile does not solve the issue.
JosephDunivan commented Dec 5, 2018 •
Using the command flutter config —android-sdk $HOME/Library/Android/sdk on Mac OS seems to have immediately solved my issues if anyone is looking for a more specific directive.
QuietLakeStone commented Dec 15, 2018
I finally solved the problem. >>Ubuntu 18 android-ndk-r16b-linux-x86_64.zip
Then modify the environment and AS configure,restart AS,no devices ->Android Device
I hope I can help you all.
DevLuuk commented Jan 8, 2019 •
I solved it on Ubuntu by adding this line: flutter config —android-sdk /path/to/android/sdk in the terminal in Android Studio.
Qinxianshen commented Jan 30, 2019
I had the same problem,
I did the following steps :
*/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor
this should work on windows
awesome ! It‘s work for me!Thank you
ValmirJuniorr commented Mar 20, 2019
I solved it on Ubuntu by adding this line: flutter config —android-sdk /path/to/android/sdk in the terminal in Android Studio.
it works perfect to me, thanks buddy.
codingcity4747 commented Mar 20, 2019
I had the same problem,
I did the following steps :
*/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor
this should work on windows
this worked for me, but I mention that after adding ANDROID_HOME path to your env variables you should restart your computer before checking flutter doctor report
good luck
DaywisonSilva commented Sep 5, 2019
[X] Android toolchain — develop for Android devices
X ANDROID_HOME = C:\Users\Daywi\AppData\Local\Android\Sdk
but Android SDK not found at this location.
avavirus3 commented Mar 18, 2020 •
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
[!] Android toolchain — develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[!] Android Studio (not installed)
[!] IntelliJ IDEA Community Edition (version 2018.2)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.41.1)
[!] Connected device
! No devices available
Источник
How to Fix Error “Unable to Locate ADB” on Android Studio?
Android Debug Bridge or ADB allows you to communicate with your devices via a command-line interface. It can be used for various purposes as it facilitates a bunch of actions including installing and debugging apps on your device. While trying to run your app via the Android Studio, you might face the “Unable to Locate ADB” error message that stops the simulation. As it turns out, the error message appears when Android Studio is not able to locate the ADB.exe file that is located in the platform-tools folder.
Unable to Locate ADB
This can happen due to several reasons including when your antivirus software removes the adb.exe file due to a false alarm. Issues like these are pretty common with antivirus software and thus, while using one, you need to make sure that it isn’t triggering a false positive on the files that you are working with. In addition to that, your project settings can also cause this error message to pop up. To understand and establish a better understanding of the error message in question, let us discuss the different reasons the issue may arise in more detail. However, do remember that the causes include but are not limited to the ones mentioned down below.
- Third-Party Antivirus — Antivirus softwares are known to cause several issues where they remove a file from your system due to a false positive. Avast antivirus has been known to cause this a lot with ADB where it locks the file in the virus chest. If this is applicable, you will have to restore the file from there and everything should be good. However, keep in mind that it may not only be limited to Avast if you are using a different third-party antivirus, but it could also likely be causing the issue and thus you should look at the files that have been quarantined by the application.
- Project Settings — As it turns out, in some cases, the error message may arise due to your project settings. The Android SDK by default does not give projects a default SDK. In such a scenario, you will have to go to the project settings and give the project an SDK which by default is set to No SDK.
- Corrupted Platform Tools — In addition to the aforementioned reasons, if your platform tools are damaged or corrupted, that might result in the error message as well. If this scenario is applicable, Windows Defender or any third-party software likely quarantines it, and as a result, you no longer have the adb.exe file in the platform-tools folder. In such a case, you will simply have to reinstall platform tools to resolve the issue.
Now that we have gone through the possible causes of the issue, let us get started by mentioning down the different workarounds that are available to you to get the issue sorted. So, without further ado, let us dive right into it.
Restore ADB From Third-Party Antivirus
As it turns out, the first thing that you should do when you face the error message in question is to check the third-party antivirus software that is installed on your system. More often than not, antivirus software can trigger false-positive and quarantine files that are not dangerous at all. In this case, the adb.exe would be the targeted file that is regarded as a dangerous or potential threat by the antivirus software and as a result removed from your system.
If this case applies to you, especially if you are using the Avast antivirus, you should check the virus chest of your antivirus software to see if the file has been quarantined by it. In case it is, simply restore the file and then try running the application. To do this, follow the instructions given down below:
- First of all, right-click your antivirus icon on the taskbar, and then from the menu that appears, choose Virus Chest.
Opening Virus Chest
- Here, check if the ABD.exe file is present. In case it is, go ahead and click the three horizontal dots in front of the file.
- From the drop-down menu that appears, choose the Restore option. This will remove the file from Virus Chest and you will be able to use it.
Restoring File from Virus Chest
- Alternatively, you can also choose the Restore and add exception option to make sure that it isn’t put away in the Virus Chest again.
Change Project Settings
If your antivirus software is not the culprit or if it doesn’t apply to you, the error message is likely being triggered due to your project settings. This happens when your project has no SDK assigned to it and as a result, it does not have access to ADB which is why you face the error message in question. To resolve this, you will have to change the default project settings which are set to No SDK by default. These settings can be found under Project Structure. To do this, follow the instructions given down below:
- First of all, make sure Android Studio is open.
- Then, make your way to File > Project Structure. Alternatively, you can click the Project Structure icon as shown in the picture down below.
- Once the Project Structure window is open, click on Project under Project Settings.
- Then, go ahead with what Project SDK is set to. If it is set to No SDK, go ahead and change it to Android API XX Platform from the drop-down menu.
Changing Default Project SDK
- In case there are no options in the drop-down menu, you can click the New button, choose Android SDK and then choose the directory where Android SDK is present.
- Once you have done that, you will be able to select Android API XX Platform from the drop-down menu.
- After you have done that, click the OK button and try running your application to see if the issue persists.
Install Android SDK from SDK Manager
As it turns out, if you are missing the relevant Android version SDK on your system, that will also cause the error message to arise. If this case is applicable, you can easily resolve the error message by installing the respective Android SDK from the SDK Manager found in the Android Studio. To do this, follow the instructions given down below:
- In the Android Studio window, open up the Preferences window by going to File > Settings.
- Then, on the left-hand side, make your way to Appearance & Behavior > System Settings > Android SDK.
SDK Manager
- Once you are in the SDK Manager, under SDK Platforms, install the SDK Platform for your respective Android version.
- After you have done that, go ahead and try running the application to see if you still face the error message.
Reinstall Platform Tools
Finally, if you are still facing the error message in question after trying the methods mentioned above, it could be that the issue is being triggered by damaged or corrupted platform tools files. If this scenario applies to you, you will have to reinstall the platform tools on your system to get rid of this error message. This can be done easily via the SDK Manager. You can uninstall platform tools via the SDK Manager and after that, you can easily install it again via a few clicks. To do this, follow the instructions given down below:
- First of all, close the Android Studio and then open up the Task Manager by right-clicking your taskbar. From the menu that appears, choose Task Manager.
Opening Task Manager
- In the Task Manager window, under Processes, look for the ADB.exe process and end it.
- Once you have done that, go ahead and open up the Android Studio again.
- Now, you will have to open up the SDK Manager. For this, click the box icon with a down arrow as shown in the picture.
Opening SDK Manager
- Once the SDK Manager is open, switch to the SDK Tools tab.
Switching to the SDK Tools Tab
- In the SDK Tools tab, scroll down until you see Android SDK Platform-Tools. Uncheck it and then click OK.
Android Platform-Tools in SDK Manager
- This will uninstall platform-tools from your IDE. Wait for it to finish uninstalling.
- Once it has been uninstalled and the Gradle is synced, open up the SDK Manager again and switch to the SDK Tools tab again. Here, look for Android SDK Platform-Tools again and tick it. Finally, click OK and wait for it to finish, and then sync your project.
- After all that is done, go ahead and try running your application to see if the error message pops up.
Источник