解决Eclipse ADT v22.0.1 升级不了v23.0.0,但又卸载不了的坑人问题

来源:互联网 发布:淘宝店铺名可以更改吗 编辑:程序博客网 时间:2024/04/29 15:25

近期由于要切换到Android Studio 开发环境,而原来Eclipse Android项目又想移植过来(我的Eclipse adt-bundle-windows-x86_64-20130522.zip,它的ADTv22.0.1),而又想保持原来的目录结构(兼容模式),所以需要

Eclipse Export 生成build.gradle文件,生成此文件需要ADT v22.0以上,刚好我的Eclipse ADT v22.0.1, 满足要求,

能正常生成gradle文件,但在后面的不同场景特别是对有依赖工程的主工程进行Import Module 后在AS环境下build总是有各种各样的问题,估计是生成的gradle文件不满足最新的AS,所以这时就想ADT v22.0.1 升级到v23.0.0

以下就是在升级ADT出现的问题:

Eclipse -> Help -> Install new software -> 

Work with 填写 https://dl-ssl.google.com/android/eclipse/

换成 http://dl-ssl.google.com/android/eclipse/


也可以点击 Add... 按钮,安装本地ADT v23.0.0离线安装包(预先下载的)

如果是在线下载 估计要FQ了,然后下面的列表会有最新ADT 的信息,然后Next ,开始安装,在安装过程中出现错误提示:

  Cannot complete the install because of a conflicting dependency.

  Software being installed: Android Hierarchy Viewer 23.0.2.1259578 (com.android.ide.eclipse.hierarchyviewer.feature.feature.group 23.0.2.1259578)

  Software currently installed: Android Developer Tools 22.0.1.v201305230001--685705 (com.android.ide.eclipse.adt.package.product 22.0.1.v201305230001--685705)

  Only one of the following can be installed at once: 

    Hierarchy Viewer 22.0.1.v201305230001--685705 (com.android.ide.eclipse.hierarchyviewer 22.0.1.v201305230001--685705)

    Hierarchy Viewer 23.0.2.1259578 (com.android.ide.eclipse.hierarchyviewer 23.0.2.1259578)

  Cannot satisfy dependency:

From: ADT Package 22.0.1.v201305230001--685705 

看错误信息提示说只能安装一次,那我想就先卸载现有版本ADT v22.0.1

那就卸载,Eclipse -> Help -> About -> Install details -> Installed Softwar找到ADT 22.0.1 选中,然后 点击底部的Uninstall, 在卸载过程中突然出现异常提示框:

An error occurred while uninstalling

session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86_64 1.0.0.M20130204-1200 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).

Backup of file D:\tools\adt-bundle-x86_64\eclipse\eclipse.exe failed.

Can not remove : D:\tools\adt-bundle-x86_64\eclipse\eclipse.exe

经BD了好久终于找到了两篇文章说了此问题:

http://stackoverflow.com/questions/24437564/update-eclipse-with-android-development-tools-v-23

 

http://stackoverflow.com/questions/9544071/an-error-occurred-while-collecting-items-to-be-installed-access-is-denied

经过分析错误日志信息和这两篇文章说到,可能是我的Eclilpse目录权限不够,在卸载或升级过程中没有一些写权限,决定将将eclipse 移动到用户目录下,用户目录下有系统级别的读写权限,但即使这样如果真的能够卸载,看日志can not remove ..eclipse.exe它是把 eclipse.exe 删除了...,如果卸载成功那eclipse目录一些文件会被删除包含这个eclipse.exe,这岂不是一个BUG?!!!

想是这样想,但我还是将eclipse目录直接移动到了C:\Users\Administrator\eclipse 下,重新打开Eclipse,以管理员身份打开eclilpse.exe

然后

clipse -> Help -> About -> Install details -> Installed Softwar找到ADT 22.0.1 选中,然后 点击底部的Uninstall

 

发现卸载成功!!!但是悲剧的是 eclipse目录下的eclipse.exe还有好多文件被删除了,此时卸载成功,

在回收站里发现了卸载被删除的文件:



我并没有立即点击restart重启eclipse,而是直接

Eclipse -> Help -> Install new software -> 升级ADT v23.0.0



在升级的过程中,又出现了异常,。。。。估计是ADT v22.0.1卸载这个大BUG造成的!!

 

最后没得办法重新去下载了一个比较新的带ADTeclipse

 

https://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip

这个里面的Eclipse ADT 版本是v23.0.2

ADT v23.0.2 解决了v23.0.0以前的许多问题。

换个Eclipse 就可以了, SDK 保持原来不动,原来的Ecllipse Android  workspace可以用新的Eclipse 打开,然后在新Eclipse 重新Export gradle文件。

早知绕这么大的弯路,我就直接下载个新的Eclipse 了,,目前为止ADT最新版本 已经到了v23.0.6


总之 解决这个问题还是 要更换最新Eclipse (adt-bundle-windows-x86_64-20140702)

1 0
原创粉丝点击