Cannot upgrade Android SDK - android

I have closed every window, restarted the computer. But Eclipse is telling me: "C:\Program Files\android-sdk\tools is being accessed....I even deleted the directory but I still get : how to fix?
Failed to rename directory C:\Program
Files\Android\android-sdk\platform-tools to C:\Program
Files\Android\android-sdk\temp\PlatformToolPackage.old01.

I have had this problem on Windows too. Instead of updating it through Eclipse, try the stand-alone option:
Close Eclipse
Open a Command Prompt window (ideally in
Administrator mode)
Run the command "android"
If you have the SDK tools directory in your path it will open the same UI you get in Eclipse but without additional file locking. If it is not in your path have a look in C:\Program Files\Android\android-sdk\tools and run "android.bat" from there.
Also, once you have updated the SDK, don't forget to fire up Eclipse and, on the Help menu, click "Check for Updates". You may well find the ADK Eclipse plugin needs to be updated too - this often goes in step with SDK updates.

Supposedly, if you use the SDK Manager.exe program rather than tools\android.bat, it works. However, I've never had any luck with that.
My traditional approach has been:
Duplicate the tools\ directory to create a foo\ directory
Adjust your PATH and other environment variables to point to foo\
Run the tools\android.bat out of foo\
Do the upgrade, which should work
When done, close out of the SDK and AVD Manager, revert your PATH and such to point back to tools\, and get rid of the foo\ directory

I'm guessing that adb is restarting with the computer. Try adb kill-server before upgrading

Another simple fix:
Close Eclipse. Open the directory where your SDK is located (C:\Users\user35\android-sdks) and run SDK Manager (as Administrator).

Related

Can't update \tools - Android SDK Command Line Tools for Windows

I have just downloaded the Android SDK Command Line tools for Windows (26.0.2). I am attempting to download selected SDK components using \tools\bin\sdkmanager.bat, as well as updating \tools. The installation fails with the following message:
Warning: An error occurred during installation: Failed to move away or delete existing target file: C:\testinstall\sdk\tools
Move it away manually and try again..
I don't see how I can remove \tools manually because it contains \bin\sdkmanager.bat.
Screenshot of the sdkmanager command:
All other components appear to install without error. See below for the components specified in my package file:
Yeah that's quite funny. A way to do that is to copy the tools folder to another place (let's say C:\temp\). Then direct into the C:\temp\tools\bin\, open the cmd prompt there and run your update commands as such:
sdkmanager.bat --sdk_root=sdkRootPath --command
Where sdkRootPath is path to your original SDK folder (C:\testinstall\sdk\). Once that is done, delete the C:\temp\tools\ copied folder.
You could temporarily rename to tools.old, run it to install new version in tools and then remove the old one.
cd YOUR-ANDROID-SDK-LOCATION
ren tools tools.old
tools.old\bin\sdkmanager.bat "tools"
dir tools*
del tools.old /q /s
tools\bin\sdkmanager.bat --list
it might be permission issue.Can you try doing sudo or if you on windows try to run terminal as administrator.
I have seen issues where the program is not able to delete the folder either due to lock or some weird reason.
Run cmd in root c:.
c:\>testinstall\sdk\tools\bin\sdkmanager --package_file=c:\testinstall\packx.txt
I've had the same issue on windows, I couldn't even rename the directory that is causing the issue.
I found out that adb was still running and ended the process and update/install worked fine without workarounds.
The below command helped me to extract the SDK
sdkmanager "platform-tools" "platforms;android-28" --sdk_root=C:\AndroidSDK_RootLocation
It may not be the answer to your question but now, i can't exactly remeber the version, you can't update SDK tools directly or using Eclipse, sdk Manager, sdk.bat or android.bat, only way is to update them using Android Studio. It's Google's new policy, i read it somewhere, if i find the link i will share it
My solution was as following:
Delete the Android SDK Tools via Android Studio (although it might complain it failed).
Close Android Studio
Manually delete tools folder from C:\Users\<MyUsername>\AppData\Local\Android\sdk folder
Start Android Studio and then do the install of the Android SDK Tools via Android Studio.

Getting error while updating tools from Android SDK Manager

I should update Android SDK Tools and Android SDK Platform-tools from Android SDK Manager. I accepted the licence terms and updating was started. But an error was occured and said me that;
The following processes:
cmd.exe
java.exe
are locking the following directory:
C:\Program Files\adt-bundle-windows-x86_64\sdk\tools
Please close these applications so that the installation can continue.
When ready, press YES to try again.
I opened the Task Manager and killed these processes. As you might guess, when i have killed these processes, Android SDK Manager closed. If you kill java.exe process, SDK Manager was also killed. This is a weird error description and not show you the right solution way. How can i update that Tools? Thanks in advance.
Follow these steps:
Close the sdk manager and eclipse.
Go to the folder where you have stored your adt.
In that adt folder you'll find a folder known as tools.
Make a copy of the contents of that folder and paste it in a folder called copytools.
Now go to the command prompt and go to the location of the copytools.
Then execute the command android.bat the sdk manager will start.
Now update all the plugins you want. It'll update your original folder.
After the update delete the copy.
I resolved this by copying my \tools folder, naming the copy \toolsCopy. Then I ran android.bat from the \toolsCopy folder with Administrator privileges.
Running the SDK manager from \tools locked the renaming of the \tools directory, for obvious reasons. SMH
Thanks it works

SDK Manager failed to install 'java.exe' locking directory

I have ran into a curious error when trying to update Android SDK Tools to revision 21 from revision 20.0.3. The ADT plug-in updated properly so now I am at a stand still until resolved.
The initial error I got listed cmd.exe & java.exe as locking the directory, I forced closed cmd.exe and got this:
If I force close java.exe then obviously my SDK Manager closes.
SDK Manager Log:
This is my work computer so I'd really like to avoid any down-time resulting from a reboot, just curious if anyone has come across this issue and been able to resolve.
I have tried closing Eclispe and running SDK Manager from the file directory, same issue, I read that someone had experienced this while having the directory opened so I closed and still, same issue. Any help is appreciated.
Eclipse:
Version: 3.7.2
Build id: M20120208-0800
Update:
Fresh reboot did NOT resolve.
I resolved this by copying my \tools folder, naming the copy \toolsCopy. Then I ran android.bat from the \toolsCopy folder with Administrator privileges.
Running the SDK manager from \tools locked the renaming of the \tools directory, for obvious reasons. SMH
It work for me after long search
Close the sdk manager and eclipse.
Go to the folder where you have stored your adt.
In that adt folder you'll find a folder known as tools.
Make a copy of the contents of that folder and paste it in a folder called copytools.
Now go to the command prompt and go to the location of the copytools.
Then execute the command android.bat the sdk manager will start.
Now update all the plugins you want. It'll update your original folder.
After the update delete the copy.
I got mine working by going into the android-sdk\temp folder and extracting the tools_r22.3-windows.zip and renaming the current tools folder to tools123 and moved the extracted tools folder to \android-sdk\
Close command line & explorer (whatever is blocking java.exe)
Cut all files & folders from temp folder (android-sdk\temp)
Paste it to some other folder say (temp_old)
Run cmd.exe (Run as administrator) and start the process again.
If still it doesn't work, manually copy tools directory to temp folder & check.
IF USING ANDROID BUNDLE
close the SDK manager and eclipse. From the SDK folder in bundle goto tools. Copy all files of the tools folder to another folder named toolscopy. Now in cmd navigate to SDK folder then to toolscopy and execute "android.bat". Now the SDK manager will execute and you can update all your updates.
you can delete the toolscopy folder as the tools folder will automatically get updatesd :D
Close eclipse and try again it will work.. (After closing eclipse Android SDK Manager window will not close)
or,
Just go to task manager and end the eclipse process and try again it will work..
I solved it in a very simple way, worked well for me.
close eclipse.exe
go to your directory containing android-sdks
run SDK Manager.exe
install required packages
close sdk Manager.exe
Start eclipse and you are almost there
update your ADT plugins by visiting Help menu in eclipse and then Check for Updates
in case if it doesn't (which it didn't in my case remove the old versions of plugins manually) work and install them again from https://dl-ssl.google.com/android/eclipse/
Steps to Resolve that
Close the Eclipse
2.Run the SDK Manager
3.Now update the packages
It works for me
I got the same problem. Then go to temp folder extract "tools_r24.0.2-windows.zip" copy "tools" folder from extracted folder and then paste it inside "sdk" folder.(or override on tools folder) :)
100 % working...
close eclipse.exe
go to your directory containing android-sdks
run SDK Manager.exe
install required packages
close sdk Manager.exe
Start eclipse and you are almost there
update your ADT plugins by visiting Help menu in eclipse and then Check for Updates
Restart your computer.
If you install SDK with eclipse in execution this error will go occur. For you resolve this problem, you should have stop the eclipse application.
I solved this using "unlocker" by emptyloop to unlock the directory without having to kill java.exe using the task manager.

Android Problem: Eclipse cannot find ADB.exe

First, I know this problem has been asked before, namely : Could not find adb.exe on my tools folder
but I tried every answer given and none work (even the accepted answer).
My problem is that I updated the Android SDK and now Eclipse cannot find adb.exe. I know where it is, it is in platform-tools directory, but I can't get Eclipse to read it from there. I updated the path.
Now what has happened is, in all my projects the asset folder is empty, meaning there is no android jar file.
Also, clicking on the SDK update manager from inside eclipse does nothing. I have no idea why.
Lastly, if I try to install new software in Eclipse (ADT update?) it wont allow it.
In the project -> preferences tab I get the following message:
Could not find C:\Program
Files\android-sdk-windows\tools\adb.exe!
I'm working on Windows 7 with Galileo eclipse.
Can anyone offer any help?
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools"
I also faced the same problem before but now i solved the problem by following the step below
Step 1: You know where your android-sdk is installed in your system if you didnt changed the location search in ProgramFiles/Android
step 2: close eclipse.
Step 3: Copy adb.exe in android-sdk/platform-tools/ folder
Step 4: Paste that adb.exe in android-sdk/tools/ folder
Step 5: Now open eclipse go to Windows --> Preferences choose android then click browse and select android-sdk with in few minutes it shows APK levels installed in your system press Apply
Solution is simple. Unfortunately I forgot you need admin rights. That's why eclipse wouldn't install new packages. I simply opened Eclipse as the Admin and everything went smoothly. Lost all my R.java files for some reason, but got them back by cleaning the project(s).
I think that's because adb has moved to
C:\Program Files\android-sdk-windows\platform-tools\adb.exe
I 've tried this once.. when i got similar problem on Windows 7 .. Copy adb.exe from platform-tools to tools folder. Now eclipse should work properly.
Yes on tools/adb_has_moved you can read:
"The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the
android tool) and install "Android SDK Platform-tools" Please also
update your PATH environment variable to include the platform-tools/
directory, so you can execute adb from any location."
the adb tool has moved to platform-tools/ but in my case no adb was in this dir but in windows 7 you can make backup of this folder (just go in folder properties->Previous version) and save backup instead of original. In my case it helps
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.

Android ADB has moved and Eclipse is looking in the old place

I did an SDK update last night and it moved adb.exe. In its place it left a file called "adb_has_moved.txt" saying
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK, launch the SDK and AVD
Manager (execute the android tool) and install "Android SDK Platform-tools"
Please also update your PATH environment variable to include the
platform-tools/ directory, so you can execute adb from any location.
So I did all that, including the PATH and now I can start adb.exe from any DOS prompt. But I still can't start it from Eclipse (Galileo 3.52). When I try it says
Location of the Android SDK has not been set up in the preferences
... which is not true. The SDK IS set up in Preferences. The real problem is at the top of the Preferences window where it says "Could not find C:\SDK\android-sdk-windows\ tools \adb.exe!" ...No kidding - the update moved it to C:\SDK\android-sdk-windows\ platform-tools. Because it's specifying a specific (wrong) path Eclipse is bypassing the PATH variable. So how do I get Eclipse to look in the right place?
I had the same problem, and updating Eclipse did the trick. Eclipse -> Help -> Check for Updates. Also see http://sagistech.blogspot.com/2010/12/can-not-find-adbexe-after-android-sdk.html.
Updating the ADT plugin from within Eclipse might help, as detailed here: http://developer.android.com/sdk/eclipse-adt.html
Alternatively, I guess you could always make the directory 'tools' in C:\SDK\android-sdk-windows and copy adb.exe in there - a bit of a hack but it should work :)

Categories

Resources