简体   繁体   English

无法升级Android SDK

[英]Cannot upgrade Android SDK

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? 但Eclipse告诉我:“C:\\ Program Files \\ android-sdk \\ tools正在被访问....我甚至删除了目录,但我仍然得到:如何解决?

Failed to rename directory C:\\Program Files\\Android\\android-sdk\\platform-tools to C:\\Program Files\\Android\\android-sdk\\temp\\PlatformToolPackage.old01. 无法将目录C:\\ Program Files \\ Android \\ android-sdk \\ platform-tools重命名为C:\\ Program Files \\ Android \\ android-sdk \\ temp \\ PlatformToolPackage.old01。

I have had this problem on Windows too. 我也在Windows上遇到过这个问题。 Instead of updating it through Eclipse, try the stand-alone option: 不要通过Eclipse更新它,而是尝试独立选项:

  1. Close Eclipse 关闭Eclipse
  2. Open a Command Prompt window (ideally in Administrator mode) 打开命令提示符窗口(理想情况下,在管理员模式下)
  3. Run the command "android" 运行命令“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. 如果路径中有SDK工具目录,它将打开您在Eclipse中获得的相同UI,但没有额外的文件锁定。 If it is not in your path have a look in C:\\Program Files\\Android\\android-sdk\\tools and run "android.bat" from there. 如果它不在您的路径中,请查看C:\\Program Files\\Android\\android-sdk\\tools并从那里运行“android.bat”。

Also, once you have updated the SDK, don't forget to fire up Eclipse and, on the Help menu, click "Check for Updates". 此外,一旦您更新了SDK,请不要忘记启动Eclipse,然后在“帮助”菜单上单击“检查更新”。 You may well find the ADK Eclipse plugin needs to be updated too - this often goes in step with SDK updates. 你可能会发现ADK Eclipse插件也需要更新 - 这通常与SDK更新同步。

Supposedly, if you use the SDK Manager.exe program rather than tools\\android.bat , it works. 据说,如果您使用SDK Manager.exe程序而不是tools\\android.bat ,它可以工作。 However, I've never had any luck with that. 但是,我从来没有运气好。

My traditional approach has been: 我的传统方法是:

  • Duplicate the tools\\ directory to create a foo\\ directory 复制tools\\目录以创建foo\\目录
  • Adjust your PATH and other environment variables to point to foo\\ 调整PATH和其他环境变量以指向foo\\
  • Run the tools\\android.bat out of foo\\ foo\\运行tools\\android.bat
  • 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 完成后,关闭SDK和AVD管理器,恢复你的PATH等指向tools\\ ,并摆脱foo\\目录

Another simple fix: 另一个简单修复:

Close Eclipse. 关闭Eclipse。 Open the directory where your SDK is located (C:\\Users\\user35\\android-sdks) and run SDK Manager (as Administrator). 打开SDK所在的目录(C:\\ Users \\ user35 \\ android-sdks)并运行SDK Manager(以管理员身份)。

I'm guessing that adb is restarting with the computer. 我猜这个adb正在用计算机重新启动。 Try adb kill-server before upgrading 升级前请尝试使用adb kill-server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM