彻底解决 Eclipse + Android 自动补全卡死的问题

问题描述:

使用Eclipse开发Android应用程序时,一旦碰到代码补全,Eclipse即进入假死状态,CPU满载(单核100%,双核50%,四核25%)...

一般十几秒,甚至几十秒才能有相应,严重影响开发心情。

 

Eclipse版本: Helios SR1

ADT插件版本: 10

 

 

解决方法:

 

Android 2.2 Froyo 

 

下载http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=froyo;sf=tgz

(base-froyo-a45d693.tar.gz)

解压缩到Android-SDK/platforms/android-8/sources/

重启Eclipse即可实现非常迅速的代码补齐。

 

 

Android 2.3 GingerBread
下载http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=gingerbread;sf=tgz

(base-gingerbread-4ddd990.tar.gz)

解压缩到Android-SDK/platforms/android-9/sources/

重启Eclipse即可实现非常迅速的代码补齐。

 

 

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=YOURVERSION;sf=tgz

 

YOURVERSION = froyo , gingerbread .....

 

 

参考:

 

http://code.google.com/p/android/issues/detail?id=7850&q=adt&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars#c7

 

 

 

This issue is happen because the ADT classpath container have an invalid source attachment by default. It is fixed in https://review.source.android.com/16569. This change enables changing the ADT clasppath container's source attachment and disables setting invalid source attachment. Hoping it will be available in ADT 8.0.0.

Namely, ADT classpath container in 0.9.x has the source attachment set to the <SDK_HOME>/platforms/android-<API_LEVEL>/sources directory. This directory doesn't exist in standard SDK. Eclipse try to cache entries in this directory on every access and it slow up auto completion.

Workaround for ADT 0.9.x: attach the valid source attachment as described on http://android.opensourceror.org/2010/01/18/android-source/
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值