1. 程式人生 > >徹底解決 Eclipse + Android 自動補全卡死的問題

徹底解決 Eclipse + Android 自動補全卡死的問題

問題描述:

使用Eclipse開發Android應用程式時,一旦碰到程式碼補全,Eclipse即進入假死狀態,CPU滿載(單核100%,雙核50%,四核25%)...

一般十幾秒,甚至幾十秒才能有相應,嚴重影響開發心情。

Eclipse版本: Helios SR1

ADT外掛版本: 10

解決方法:

Android 2.2 Froyo 

(base-froyo-a45d693.tar.gz)

解壓縮到Android-SDK/platforms/android-8/sources/

重啟Eclipse即可實現非常迅速的程式碼補齊。

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

解壓縮到Android-SDK/platforms/android-9/sources/

重啟Eclipse即可實現非常迅速的程式碼補齊。

YOURVERSION = froyo , gingerbread .....

參考:

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/