My favorites | Sign in
Project Home Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 7850: SDK: eclipse freezes when when "android.R.attr" is selected from autocomplete popup
58 people starred this issue and may be notified of changes. Back to list
Reported by kostmo, Apr 19, 2010
System: Ubuntu 9.10 x86_64
ADT version: 0.9.6

Steps to reproduce:

In a the body of method, type "android.".  The autocomplete popup should be
displayed. Hit enter to select "R", then type period (".") again to be
presented with more autocomplete options.  Hit the down arrow 5 times to
get to "attr".  Hit enter. Observe freeze.
May 23, 2010
I have the same problem - it freezes as soon as the pop-up appears for me when I type 
"R." or if I copied "R.layou.main" into the body and then clicked on the line to 
select it. I can easily reproduce in the HelloAndroid tutorial.

System: Ubuntu 10.04 amd_64
Eclipse Version: 3.5.2 (lucid)
ADT Version: 0.9.7
380 bytes   View   Download
Jun 15, 2010
It comes back after a few seconds/minutes (depending on your box). Meanwhile it's maxing out the CPU.
Jul 9, 2010
I encounter a similar problem. Eclipse Auto-complete is working fine for any Java project, however for Android development, auto-complete is freezing /crashing eclipse. It just freezes eclipse for about 30 seconds to 1 minute, making development impossible.

Steps to reproduce:

1. create an android project
package com.example.helloandroid;

import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        TextView tv = new TextView(this);
        tv.setText("Hello, Android");

2. I try to use setText again for tv, typing the dot "." still works without problem, but typing "s" just freezes eclipse for some time.

Any ideas where to start looking for a solution. Is it related to Xulrunner?

Jul 31, 2010
I'm getting this too.  Very annoying, but glad I'm not on the only one.  Android SDK is the only thing extra I have installed in this instance of Eclipse.  I have other instances of Eclipse and auto-complete is just fine.
Aug 2, 2010
Change Eclipse version to 3.5.2 and install last ATD plugin :)
Oct 10, 2010
Same problem. Auto completion hangs up freezing Eclipse for some seconds. Really annoying.

OS: Windows 7
Eclipse: Helios
Java: 1.6
ATD: 0.9.9
Oct 14, 2010
This issue is happen because the ADT classpath container have an invalid source attachment by default. It is fixed in 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
Oct 31, 2010
For those of you with this problem, here's what you can do until the fix is publicly available:
1. Download ";a=snapshot;h=<branch>;sf=tgz" where <branch> is one of those listed here (froyo for 2.2, the file is about 113MB):;a=heads
2. Extract the contents of base/ in the tar into "<path-to-android-sdk>/platforms/android-<api-version>/sources" where <api-version> is 8 for froyo, 7 for eclair, etc.
3. Enjoy fast content assist in 3.6!
Nov 17, 2010
Thanks @jongjengset :)
Nov 30, 2010
Thanks jongjengset, that worked like a charm.
Dec 16, 2010
@jongjengset "Flawless Victory !!!" :D Thx man .. saved me a lot of time :)
Dec 18, 2010
@jongjengset Thanks a lot for your suggestion!!! That worked great for me!!!
And plus now I can also browse and debug through Android native code, if necessary.

I've pointed to your solution in a couple of threads that I found during my search before finally running into this one with the actual solution.

Well done!
Dec 19, 2010
After having applied jongjengset's tip, code completion works like a charm again. But now I get an error message when loading up Eclipse (to be specific when Eclipse tries to load the Android data) telling me, that a NPE occurred while refreshing external resources. Although this seems to have no further negative effects I'd like to know what goes wrong here. Any ideas?
Dec 25, 2010
@jongjengset, thanks.  Works for me too.
Dec 25, 2010
@jongjengset, works for me, verified on Froyo & Gingerbread, thanks !
Jan 2, 2011
This is ridiculous. It's quite a blocker issue that takes Google more than half a year still not fix it with latest ADT plugin!!!
Jan 4, 2011
For me this was fixed by change the Project Build Target.

Right click on the project and select Properties.  Under Android I changed from Android 2.1-update1 to Android 2.2 or Google APIs.
Jan 12, 2011
This still happens with ADT 0.9 - preview 3. The 8.0 versions have it as well.
Jan 13, 2011
actually it seems that you don't have to put all the sources in the directory to fix the eclipse freeze. 
Just create empty "sources" directory in every platform directory <SDK_HOME>\platforms\android-<API_LEVEL>\sources

that worked for me.

ADT 8.0x has some other annoying bugs, my suggestion is also to install 9.0 preview 3 that works like a charm :)

Jan 17, 2011
There is bug in Eclipse related to Javadoc attachment. You can take a look at
Jan 30, 2011
Cheers @jongjengset!
Feb 1, 2011
@jongjengset Thank you!!! :) It was really annoying.
Feb 4, 2011
@jongjengset I'm very happy now :) Thank you!
Feb 6, 2011
I'm running ADT 9.0 and was having the same problems. Really, really frustrating.

However @jongjengset's advice worked like a charm for me as well. Plus, you can browse through Android OS source when developing which is REALLY helpful.
Feb 8, 2011
try to follow jongjeng but need git.
download git? install git? learn how git works?
man too much work ...
Feb 12, 2011
I fear you'll not get much sympathy from here if you can't be bothered to install a simple source control client and follow some step-by-step instructions... You're a developer aren't you??
Feb 12, 2011
You don't need to understand git, it's just a link that generates an archive from a git repo automatically.
Feb 15, 2011
C-C-C-ComboBreaker!!! This rocks! Thanks guys!
Feb 16, 2011
#29 igosuki
Indeed having the sources greatly accelerates it :) 
Thanks mister Jong Jeng !
Feb 17, 2011
Thank you! Worked like a charm :)
Feb 21, 2011
Like a charm.  Thank you!!
Mar 3, 2011
works like a charm. but this is still a temporary fix.
when will ADP get an official bugfix for this?
Mar 11, 2011
Adding empty "sources" directorties as suggested in comment "Comment 19 by, Jan 13, 2011" is by far the simplest solution. Worked for me! :-)
Aug 7, 2011
#19 don't work for me. Any other suggestion ? 
Dec 22, 2011
I'm seeing this issue using Eclipse 3.7 for the exact same scenario: android.R.attrs.
at this point the system becomes busy for about 10 (yes I'm not exaggerating, that's 10) minutes!
Jan 24, 2012
Yepp, confirming this is still happening with Ubuntu 10.10 64bit, Eclipse 3.7.
Feb 24, 2012
I am using Eclipse more than 10 years.

After I install Android, it fucked my eclispe. It hangs every 10 minutes. Every time kill the Eclipse process and restart eclipse.

Fucking android sdk.
Apr 2, 2012
Confirming this is still happening.

Ubuntu 11.10
Eclipse 3.7 Service Pack 2
Java: Oracle 7
Latest SDK etc

Typing android.R.attr in ANY SDK version (even 14 and 15 with source downloaded and correctly working in eclipse) will cause the java process to completely lock (CPU usage up to 100%) and have to force close.

jongjengset's tip unfortunately is outdated now (link redirects to their repo page) and there is no clear fix or workaround mentioned regarding this anywhere.

Any tips from anyone? Extremely frustrating as this is literally making my app development impossible at the moment.

(I have only found it occur for android.R.attr)
Apr 29, 2012
Confirming this is still happening too.

Windows XP SP3
Eclipse Helios

It was not fun. It makes the development time extremely long. Please anyone who knows who to solve this issue
Jul 25, 2012
#40 jonfhancock
Still happening in Helios with ADT 20.
Jul 25, 2012
Project Member #41
Sorry, this bug wasn't filed in the tools category, so we hadn't seen it. I'll investigate now.
Status: Assigned
Labels: Component-Tools
Jul 25, 2012
It looks like there are two separate problems here.

First, in the past (up until about ADT 9) there was a serious bug in our classpath container which meant that with source code attached, nearly every single code completion call in Java files could be really, really slow.

This is what the bug was originally filed for.

Second, there seems to be a problem completing the android.R.attr. class specifically. This problem is apparently still a problem. I'm not seeing this problem on my computer (though I'm going to try some other platform nexts), but I can guess the reason: The android R classes are huge, so if there's any kind of inefficiency in the code completion code, such as a quadratic algorithm, it would certainly manifest itself there. ADT has custom code completion for XML, but nothing for Java, so this would be an issue in the Java code completion code, but maybe there's something we can do to workaround it. Until I can reproduce the problem, it's hard to say.
Jul 25, 2012
I didn't see this problem on OSX, but I was able to reproduce it on Linux. 

Eclipse is stuck in the following for (at least) a couple of minutes:

"main" prio=10 tid=0x00007f17b4008000 nid=0x1e0f runnable [0x00007f17bbef8000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.internal.gtk.OS._pango_layout_get_line_count(Native Method)
        at org.eclipse.swt.internal.gtk.OS.pango_layout_get_line_count(
        at org.eclipse.jface.internal.text.html.BrowserInformationControl.computeSizeHint(
        at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(
        at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(
        at org.eclipse.jface.text.AbstractInformationControlManager.setInformation(
        at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(
        at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(
        at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(
        at org.eclipse.jface.text.contentassist.AdditionalInfoController.showInformation(
        at org.eclipse.jface.text.contentassist.AdditionalInfoController$10.showInformation(
        at org.eclipse.jface.text.contentassist.AdditionalInfoController$
        - locked <0x00000000df3fbeb8> (a org.eclipse.jface.text.contentassist.AdditionalInfoController$10)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(

Jul 21, 2014
Project Member #44
(No comment was entered for this change.)
Labels: Triaged-yes
Sign in to add a comment

Powered by Google Project Hosting