android studio platform-tools missing adb.exe - android

Today, I clicked some update when I launch Android Stodio. I forgot what it is. Then, I run some code when there is a error
"8:34 PM IllegalArgumentException: Unable to locate adb"
Then, I google for few hours and still cannot solve my problem. And I found that there is no "adb.exe" under my platform-tools folder.
Can someone help?
my os is Window 10.
I have tried uninstall Android Studio and install it back. It doesn't help.
Edit 1: After I re-install the platform-tools, I get back the adb.exe.But, I run my program again, it does the "ADB initialization", my adb.exe file lose again.

I am writing the solution which worked for me:
go to SDK Platform Tools;
download SDK Platform-Tools for Windows;
extract zip file and copy to \AppData\Local\Android\sdk\platform-tools.

Had the same problem. Solution was that Avast deleted the adb.exe.
Try adding the SDK folder to your antivirus whitelist.

What worked for me (after having AS 2.x and AS 3.x installed and trying to get Canary 3.1 to work):
Sometimes during an update/trying to sideload a new version of Android Studio, the updater/patcher screws up. It might delete adb after saying it will stop and update it, it might be fastboot or aapt ... whatever.
What works for me is to delete the whole sdk/platform-tools folder, restart AS and get it to redownload the entire platform tools package.
Then start AS again and go to File->Invalidate caches/restart.
If you have been updating Java, you might also want to ensure your JAVA_HOME is correct and that your AS project has been set to the correct JDK (project settings).

Yep, looks like LOTS of folks (way too many, shame on you, Google) have come up with a missing 'adb.exe' symptom. (In my case, I claim that it never got installed at all, during my Windows-10 bundled installation of Android Studio,
version 3.1.2.)
Ok, here's my recommended solution (which I borrowed and modified slightly from
this question): Android Studio SDK installer hangs indefinitely at Unzipping 'platform-tools/systrace/NOTICE'
The second(?) answer is essentially correct..."Dx Arout" boldly and correctly recommends:
(1) Delete platform-tools from this location C:\Users\AppData\Local\Android\Sdk
and he/she's got the right idea, to then launch Android Studio and try to get it to complain and offer to fix the problem for you...says to:
(2) Then restart Android Studio. After gradle build finish it will ask for installation of missing tools. just click there. It should work fine.
Well, no, not quite. It didn't ask me anything, because I didn't get any
errors from current proj's build. So, I had to 'kick-it-in-the-*ss', by
launching Tools -> SDK Manager, choosing the middle tab ('SDK Tools'), and going to an already-installed entry named 'Android SDK Build-Tools 28-rc2' (your exact version entry may be somewhat different). So, click on its checkbox, choose 'Show package details' checkbox (down in lower-right corner). I lit up ALL the package variants, and forced it to install them all. That may have been overkill, but voila...once that completed, 'adb' DID get installed, as confirmed
when I launched a debug run. (Down in the 'logcat' tab's log-message window, the two RED headings, finally turned to black and debugging was finally USEABLE!
Cheers...

it's easy just go to your sdk location
like C:\Users\User\AppData\Local\Android\Sdk
there was to folder namely
platform-tools and platform-tools.backup.
open platfrm-tools.backup and copy the adb.exe and paste it to plaform-tools folder and now open the android studio again.studio will run smoothly and without any error
Thank you

I also faced the issue.
The avast antivirus had moved the file adb.exe to the virus chest and that was the cause of the issue. I have resolved it by restoring the adb.exe from the virus chest of avast.

Re-installing Android SDK Platform-Tools worked for me.
Go to: Android Studio >> Tools >> SDK Manager >> Appearance & Behavior >>
System Settings >> Android SDK >> SDK Tools
Uncheck Android SDK Platform-Tools >> apply
Check Android SDK Platform-Tools >> apply

The problem is solved. The issue I have is I upgraded the SDK platform-tools to 25.0.6. But My SDK Build-Tools is 25.0.3. (25.0.6 is not yet provided) I guess the version did not match which cause this problem.
I downgrade my SDK platform-tools to 25.0.3 and it is working as usual.

adb.exe won't appear if antivirus is installed and we need to whitelist this.
Anti virus block this because as it find .exe file so it will block it.

system deleted that file from platform tools u just make another copy of platform tools and whenever your system deleted your " adb.exe ". you can copy it to sdk/ platform .
this is a temporary solution i installed Quick Heal but its doesn't solve my problem
adb.exe is virus file for that its detected as malware
**
Solution 2 :
** Copy your SDK FOLDER in System folder where antivirus dont take action on it .
**
Solution 3:
1.Download new copy of Platform Tools
2.paste it into SDK
3.right click on adb.exe and go to security tab
4.disable access of deleting by user system USERGROUP
Solution 4
copy sdk in appdata/local it will solve your problem permanent .
Thank You

no adb found. I had to delete the virtual device from AVD manager create another. now virtual device connected succesfully

Related

Android-studio Selected directory is not valid home for Android SDK

I installed android studio but while selecting android SDK I am getting following error. I tried solution which is on this post but no luck. How can I solve this?
I had this problem, select SDK folder (NOT SDK->sources or SDK-platforms)
I resolved with the instructions here,
http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/
Just close current error window and let run the android studio
Open the SDK manager as shown below
Click on Edit SDK location as shown below
Simply press next button if there is correct location for SDK you want to install there
Let it be downloaded
Install platform and SDK tools and
Enjoy
Try restarting the application. Close all related studio processes, then right click "run as administrator".
You should be fine after this.
I got the same issue. You must enable the Android Support Plugin
Configuration > Plugin > Android Support Plugin. Check it.
Close error window
Go to gradle tab
select "Gradle settings", wrench icon
Search for SDK setup
Select appropriate sdk for your device.
Next, two times
Wait for install
There is all..
None of the other answers work. After the installation, immediately close Android Studio, then start it as administrator. A message might popup asking for the sdk manager location. Ignore it (Close the popup). Go to Tools > SDK Manager and click on the edit button on the right of Android SDK Location. Then click Next, next and you're good to go. Android Studio will let you install the sdk manager.
I had the same problem but what I found is that it requires the parent folder of the following things AVD manager,SDK manager,tools,platform-tools,build-tools etc.So what you need is to find the parent directory of these things, which you might find with a name such as android-sdk or android-sdk-windows(in case you are using windows OS).Make sure the above said contents are in that folder and select it.I hope you will find this useful.
Download the SDK from http://developer.android.com/sdk/index.html
Start SDK manager and make everything up to date
Also, make sure you have set the language level to
7.0 Diamonds, ARM, Multi-catch, etc
I had this problem on Linux. Apparently you need write access to some place in that directory, so I just took ownership of the entire thing:
sudo chown -R thomas:thomas /opt/android-sdk
Could be that something similar is going on on Windows as well.
If like me, a MacOs user which has installed Android Studio on my Mac and if you've tried everything you can think of but was still unable to set the Android SDK directory in Android Studio, follow the next steps (I know the site where I got the bundle is a freeware site but the package is the right one):
1. Download adt-bundle-mac (Android Developer Tools) from [here][1].
2. Unzip the file and browse into the unzipped folder.
3. Copy only the sdk dir to /Users/username/Library/Android
4. Open Android Studio, the error about the SDK folder which is not set will pop up, set the path to the SDK to "/Users/username/Library/Android/sdk".
5. Now Android Studio will accept the path and you're good to go.
I wasted about 2 hours until I fixed it so I hope that by writing this answer I'll save you some 2 hours.
The sdk folder contains the platform-tools folder.
I copied this folder and named it platforms, then it worked for me.
Just delete(preferably permanently) all the android directories in whatever location they are present(e.g. C:\Program Files\Android, C:\users\respective user\respective android folders). Remove the installer as well(if possible). Make sure to save all your Android Studio files in some external storage (preferably).
The main thing is to get Android studio with SDK.
Now go to the android studio website and install android studio leaving all settings default. There you will also get to install the SDK and it's linking.
It will take some time to load and will load nearly 1.5 GB files.
This worked for my case.
In my case I wasn't giving him admin permission
Steps to follow:
Close Android Studio.
Restart Android Studio and Give the path of Empty Folder .
Install Sdk in that folder(Sdk will automatically install and will get configure automatically.)
With Android Studio 4.1.2 the easiest thing is to close the project (file / close project). That's how you get to the wizard that automatically sets up the SDK for you.
The default location that it suggests is /Users/stan/Library/Android/sdk (exactly the same that I was trying to set up manually but AS kept saying it's invalid)

"No system images installed for this target" even though Image is installed

So I'm trying to create an AVD Simulator, and I keep getting the "No system images installed for this target" error when trying to create a 4.2.2 system even though the image is installed (See picture of SDK Manager).
My system is x64, does that make a difference?
After SDK Update I had the same problems with API Level 19 and
in my case restarting eclipse didn't solve it.
For some reason, in the sdk/system-images/android-19 directory, sub-folders with system images (armeabi-v7a and x86) were placed within "default" directory.
I just moved them into android-19 directory (if eclipse is running at the same time, you will have to restart it).
You just need to restart the tools. I have seen this bug before. The appropriate installed images will show up after the restart.
You can also try to refresh within the 'Packages' menu, but the easiest thing, is to restart the tools.
Goto sdk\system-images and open the folder of the current API you are using (eg.android-19 folder in your case).
Now you'll find a folder named 'default', open it and you'll see the folder named 'armeabi-v7a' or which ever system image you've installed.
Now move the folder 'armeabi-v7a' to the directory sdk\system-images...i.e simply out of the 'default' folder.
That's it.
I had the same problem and this method worked for me. :D
I restart eclipse.it worked out for me,issue is resolved.
I just had this same issue. My problem was solved by killing eclipse (Command + Q) because I'm a Mac user. So, if you're under other operative system be sure to kill the Eclipse's process and relaunch it.
Lots of potentially useful answers here, but none of them were worked for me.
On my Mac, I have both Android Studio and Visual Studio installed. One would hope that they would automatically look for an Android SDK in the same place, but no, not necessarily.
In Android Studio, go to Tools -> Android -> SDK Manager. In the window that pops up, make a note of the Android SDK Location. It should be something like
/Users/[user]/Library/Android/sdk
Next, in Visual Studio, go to Tools -> SDK Manager. In the window that pops up, the path that should be selected on the left is Projects -> SDK Location -> Android. On the right, click the Locations tab. For me, the Android SDK Location path was set to something like
/Users/[user]/Library/Developer/Xamarin/android-sdk-macosx
I changed this to the path that Android Studio was using, and that fixed the problem for me.
Very simple. I restarted Eclipse, reloaded my project and when creating a new emulator, the problem is gone
Found this thread when I did a search on Google for the same error.
So I just wanted to add that if anyone comes across this thread but you are using Android Studio. You only have to restart the Android Studio. I did and now I can see what I installed.
Make sure you have rights to all the files in the android-sdk-linux directory using:
sudo chown $USER -R ./android-sdk-linux

Updating Android SDK: "A folder failed to be moved."

While trying to update my Android SDK I am encountering this error when trying to install this particular package:
How do I fix this?
This happens once in a while on my Windows SDK (even when I don't have any antivirus or similar programs running, execute the SDK-Manager as an administrator and so on).
I just update the tools by hand in this case. Which means close the SDK-Manager after the error and open the ANDROID_SDK\temp folder. There should be a zip named tools_R16.zip or similar (don't remember the exact name). Unzip that. You should end up with a tools folder. Copy all the files from this folder into ANDROID_SDK\tools. Overwrite when asked. And take a backup of the SDKs tools folder beforehand, just in case something explodes.
After that, start the SDK-Manager again. The tools version should be updated.
The problem seems to be that Eclipse, or even the SDK Manager itself, locks the folder. Running android.bat from the tools folder should do the trick.
If you launched the SDK Manager from Android Studio then all you need to do is close Android Studio.
I presumed the SDK Manager was a modal dialog that was part of Android Studio - not a separate program.
thanks. this is how I fixed it:
I updated the tools by hand in this case. Which means close the SDK-manager after the error and open the folder android-sdk-windows folder. Using LockHunter, unlock all programs from holding a lock on the android-sdk-windows\tools\ folder. http://lockhunter.com/?ver=&vertype=pro&sm=main_window_64
RENAME the android-sdk-windows\tools folder beforehand to tools_DELETEME
There should be a zip named android-sdk-windows\temp\tools_r19-windows.zip. open that, You should see a tools folder in it. Copy that tools folder to android-sdk-windows\tools
After that, start the SDK-manager again. The tools version should be updated.
When you install tools/softwares use SDK manager. But don't use it when update. Do right click -> Run as administrator on android-sdk-windows\tools\android.bat file for updating tools. Always try to run commands as Administrator specially on Windows Vista/7/8. That'll fix most of permission issues etc...
You probably started the SDK manager from eclipse? I encoutnered the same problem, and fixed it by manually opening the SDK manager from the directy tools.
My solution was to start it from within eclipse - as Administrator.
well i had the same issue on windows 7 ... problem is that during the update it tries to rename the tools folder (inside the SDK folder) and that folder is used by a process "ADB" which is currently running ...
so you cannot do the update smoothly until you stop / kill that process ...
BTW copy pasting the new contents of tools folder from the temp would also work ...
With windows 7, when "failed to install popup" appears kill the process called adb (from task manager ctrl+alt+del) then press "Yes" and stuff is being installed.
I tried running android.bat and got the same error.
What worked for me was using unlocker to unlock the \tools folder.
Ensure you don't have any essential files or folder opened/being used by other applications including explorer.
I've read before, people take a copy of the platform-tools folder and run the update from a different location. This ensures you haven't got open the files it's trying to update.
Could also disable your antivirus for 5 minutes o0o0.
On Windows 7 and probably Vista, run Eclipse as administrator.
My problem was Windows 7 security. I opened up the security on C:\Program Files\Android to EVERYONE with FULL access and it then worked. I then removed EVERYONE after the update was complete.
I had to make a copy of the tools folder itself (keeping it at the same directory tree
level, thus "tools" and "tools-copy" were both in the "android-sdk-windows" folder).
Then ran Android.bat from that copy.
After the update just delete the tools-copy folder.
The error message was Failed to rename directory C:\devtools\android-sdk\system-images\android-21\google_apis\x86 to C:\devtools\android-sdk\temp\SystemImagePackage.old01. I deleted the C:\devtools\android-sdk\temp\SystemImagePackage.old01 directory by hand (it was a leftover? I don't know) and it was able to proceed.
Same error i got while updating sdk. It is because of targeted folder locked (access permission is denied).
You can resolve it as follows in "Ubuntu" :-
Press ALT + F2 and type 'gksudo nautilus' and navigate to the targeted folder like tools or extras and give create and delete permission.
then update, every thing will be working fine :)
First make a copy of tools folder in same directory (android-sdk or android-sdk-windows) then delete the original tools folder and then open the android.bat file by double clicking in tools-copy folder to launch sdk manager and install the tools.
If tools folder is not being deleted then use the unlocker LockHunter to delete the folder and then open android.bat to update the tools.
After successful installation of tools delete the tools-copy folder.
Close Eclipse or Android Studio if open.
It worked for me!!!
On my PC it was caused by monitor.exe running in the background. Terminating that proces solved the problem.
Close the currently launched android studio window from task manager by going to the studioprocess (So when closed there are currently no active studio windows). Then go to Android studio in windows explorer, select the studio64/studio(if 32 bit OS) and right click and select run as administrator.
In one line - you need to run Android Studio as a administrator.
These are the steps followed by me.
Restart the computer.
Open "C:\android\androidStudio\sdk\tools\android.bat" as admin.
Now install packages should run fine.
I know this is an old post but I want to write my personal solution to the problem:
Failed to rename directory C:\android-sdk\tools to C:\android-sdk\temp\ToolPackage.old01.
Obviously I have had the same issue and every time the Android tools needs to be updated it's a nightmare.
None of the solutions I found googling the net worked for me up now, but this is a vital job to maintain Android SDK updated. So I started to find an alternative working way to solve this issue and I found it finally.... at least... it works for me, even if it is a bit tricky.
The basic problem is that the android.bat batch file comes from the ~\tools\ folder and it's still in memory (running) while the same ~\tools\ folder needs to be updated (in our case, renamed).
The problem is that the android.bat runs java to launch swt.jar (the SDK tool), and it remains uselessly waiting for completion of this java program.
You can edit the android.bat and see the call in the latest row of this batch:
call "%java_exe% %REMOTE_DEBUG%" "-Dcom.android.sdkmanager.toolsdir=%tools_dir%" "-Dcom.android.sdkmanager.workdir=%work_dir%" -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*
The problem is the "call" CMD command. It waits for the called external program completion.
But ther's another way to run external programs from a batch file: the "start" command. It launches an external program and terminates.
So I just replaced the "call" command with "start", so that after the change the latest row of my android.bat was:
start "" "%java_exe% %REMOTE_DEBUG%" "-Dcom.android.sdkmanager.toolsdir=%tools_dir%" "-Dcom.android.sdkmanager.workdir=%work_dir%" -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*
Note: Keep the "" in between start and the application path. You can add text in those hyphens and this text will be the caption of the java.exe command window you will see after the changes. In my case I left the caption as an empty string but you can write there what you want.
After the changes, you can start the SDK and the android.bat will be no more waiting, leaving the SDK tool free to play (and rename the ~\tools\ folder without headaches).
Obviously, after updating the SDK tools, you have to redo the same changes in the new, updated android.bat batch file. This could be a bit unconfortable, but you'll have just to remember to make the changes before running the SDK tool and you'll have no other headaches while updating Android.
In Ubuntu following solved issue for me
cd [tools/directory/path]
sudo ./android
Solved this on my side by killing the adb.exe in Task Manager.
I just stopped the emulator, and problem was solved.

eclipse will not find ADB.exe or SDK

I am going nuts.I update to the Android SDK in Eclipse, Eclipse can't find the SDK. There is a text not that saids the the file has been moved to /platform-tools, however the file ADB.exe is nowhere to be found in any of my folders. The SDK Manager works find but for some reason Eclipse will not find the file its looking for. I have looked everywhere for the answer. It work find for about 4 months until I upgraded. I also now using a real device a Droid X2. But I don't believe this is the issue. I can't find the ADB.exe file. Help been working on this for about 2 days
adb.exe was relocated from {ANDROID_SDK_FOLDER}/tools to {ANDROID_SDK_FOLDER}/platform-tools: find your SDK folder and look inside it for the platform-tools folder.
EDIT: in Eclipse, if you open the Preferences dialog (Window->Preferences) and select the Android option on the left it will show you what Eclipse THINKS is your Android SDK folder. If you moved the SDK folder you should update the path to match the new location of the SDK folder, and then (a restart might be necessary) Eclipse should work fine with the Android tools.
EDIT: well, I can't tell if your ADT isn't properly installed or if the SDK location is broken, so lets try and brute force set the SDK location. Create a text file on your desktop called "adt.pref", and then place only this line in it:
/instance/com.android.ide.eclipse.adt/com.android.ide.eclipse.adt.sdk=C\:\\Program Files\\Android\\android-sdk
then in Eclipse select File->Import then select General->Preferences and then pick that file. This should force the ADT location to match what that is. Restart Eclipse and see if that improves things.
I had the same problem and solved it by running the android sdk-manager (you can do that without running eclipse, using the start menu shortcut) and installing the Android SDK Platform-Tools through it (select the square and click install packages...).
Download the SDK here.
Once that's done, I would just follow the Google installation instructions again from the beginning. Perhaps you're missing something fairly simple?
Installation instructions.
I got the same problem. In my case it was caused by an upgrade on the Java JDK. I was using 1.6 and upgraded to 1.7.
Just manually add the new JDK to Eclipse.
Right click on your project JRE System Library. Select installed JRE, and then find it on your computer.
I had the same problem, and when I looked inside the platform-tools folder, it was empty.
After searching for downloading the contect of this folder, I found the below link.
http://venomvendor.blogspot.com/2012/06/android-adt-20-updated-download-offline.html
But it also could not help me.
At last I found that it's related to my internet connection.

Error received when updating the SDK with the SDK Manager

I'm completely frustrated with the Android SDK Manager.
I'm running Win 7 Home edition and have the SDK installed in its own top level directory on my D:\ drive.
When I run SDK Setup.exe from the command line (and I've even opened the prompt as an administrator), I get an error when trying to update the packages.
The SDK manager is telling me that I need to install the SDK Tools rev 7. But when I accept the license, I get an error message stating:
"A folder failed to be renamed or removed" yada yada yada. The Installing Archives window says "Failed to rename directory D:\android-sdk-windows\tools to D:\android-sdk-windows\temp\ToolPackage.old01."
I looked here for help:
http://groups.google.com/group/android-developers/browse_thread/thread/4b784f3eb1e096fd/ecadfb28ce5daf5f?lnk=gst&q=cannot+rename+folder#ecadfb28ce5daf5f
but the content there didn't help.
I DO have my antivirus (AVG) disabled.
I DO NOT have any other programs running -- just the command prompt to launch the SDK Manager.
I have even given the everyone group, for the D:\android-sdk-windows\ folder, full control.
I tried to rename the tools directory before starting the SDK Manager but then I get an error that a batch file cannot be found when I try to launch SDK Setup.exe. Grrrr.
None of this works.
Suggestions how to get the package to update without error are greatly appreciated.
Thanks!
A simple thing,
There will be zipped file after this error has been occured. Meaning that Updated tools got store as
tools_r16-windows.zip in C:\Program Files\Android\android-sdk\temp
Just extract it and copy it in our tools folder
C:\Program Files\Android\android-sdk\tools
Enjoy:)
I think ths might help. Please give your comments!!
If you get this error while using Eclipse on a 64-bit Window 7 (might 32-bit as well), exit Eclipse, go to your SDK folder and run "SDK Manager.exe" as Administrator. In my case, Eclipse turned out to be what locked the folder in the first place.
# Stratos - Thank you for your instructions, they worked for me.
Go to Android\
android-sdk\
tools\
Delete "source.properties" (Right click - delete)
Open SDK Manager and update
And everyone lived happily ever after...
You can't use 64 bit java or 64 bit eclipse. That's almost certainly your problem.
Had the same problem. For me it was a bit circular, the SDK manager had a hold at source.properties and closing the process terminated the update. I deleted android-sdk\tools\source.properties before running the SDK manager and it all worked. Oh and I was not updating through Eclipse so it is not an Eclipse problem.
I can't vote yet, or I would have voted for Stratos.
I had already disabled my Norton antivirus (after reading other posts).
Removing the source.properties file helped.
Don't forget to run SDK manager with admin rights if not already.
There is another simple way:
When the SDK asks to install the Java SE JDK press back and then press next. This time it will detect the installed JDK. I solved this problem twice with this method
Use Unlocker to unlock the tools folder.
Right click on tools folder -> Unlocker. This way you don't even have to find out what is locking the folder...
Start task manage and end Adb.exe. Thisnisnthe program that has a hold on the folder. Rename the tools folder to some other name eg. 'toolsold'. Then extract the zip file containing the new tools folder. Rerun the updates and it should be detected as updated and it should proceed with the outstanding tasks.
Run SDK manager as Administrator, this fixed for me

Categories

Resources