mac eclipse报错:failed to get the required adt version number from the sdk的解决办法

【注意!】 
1、这个文章讲的方法,只是让eclipse能正常运行android项目,eclipse每次打开还是会报错的。 

2、彻底解决要重新下载一份eclipse专用的sdk,下载附件文件没用

前言

一直都用android studio(mac系统)开发,今天用eclipse打开一个android demo项目时,发现eclipse报错。
无法运行android项目,说adb server发送错误。
google了半天,找到了一个解决的办法,在这里介绍一下。


1、报错内容

1、eclipsed打开后报错:

Failed to get the required ADT version number from the SDK.
The Android Developer Toolkit may not work properly.

如图: 
这里写图片描述
点击Open SDK Manager也打不开Manager。 


2、运行项目时,报错:

The connection to adb is down, and a severe error has occured.
You must restart adb and Eclipse.
Please ensure that adb is correctly located at '/Users/xuye/Library/Android/sdk/platform-tools/adb' and can be executed.

如图: 
这里写图片描述
说adb的服务发生了一些问题。 

2、问题原因

2.1、我在google上,先搜了下adb的报错,尝试了几个都没有解决问题。 
而且adb运行后看起来是正常运行的,也确实没啥问题。 
我觉得虽然adb报错,但可能不是adb的问题。 


2.2、尝试搜索”Failed to get the required ADT version number from the SDK”这个报错, 
发现有人说是因为升级了android studio到2.3,并且更新了sdk到api 25。 
我确实前一阵升级到了2.3也更新了sdk到25,看来问题很有可能是出现在这里。 
我又看了几个stackOverFlow的对话,发现是因为谷歌把android sdk的某些文件删掉了,并且一些文件的路径也做了修改。 
android studio用这个sdk没问题,但是eclipse使用这个sdk就有问题了,非常坑爹。 

3、解决办法

3.1、如果只想让eclipse运行android 项目的话, 
就拷贝一个traceview文件到现在的android sdk tools目录下, 
这个地址在mac上的路径一般是:

~/Library/Android/sdk/tools

【注意】mac的系统要使用mac专用的traceview文件,如图: 
这里写图片描述
【ps】traceview文件我会放在文章的附件里。

当我添加了traceview文件到tools目录下, 
并重启eclipse后,就可以运行android项目了。如图: 
这里写图片描述


3.2、如果想解决后续的各种问题,建议把android studio和eclipse使用的android sdk分开。 
也就是说,为eclipse重新下载一份专用的sdk,而不是和android studio公用一份。 

至于怎么下载sdk,设置eclipse,可以自行搜索。 


备注:

下载下面的内容,并在tools文件夹下找到traceview文件。

win用户:https://dl.google.com/android/repository/tools_r24.4.1-windows.zip
mac用户:https://dl.google.com/android/repository/tools_r24.4.1-macosx.zip


猜你喜欢

转载自blog.csdn.net/xuwenwen_2013/article/details/79636246