My favorites | Sign in
Project Home Issues
New issue   Search
for
  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
#1 Jason.Wi...@gmail.com
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
HelloAndroid.java
380 bytes   View   Download
Jun 15, 2010
#2 fooba...@gmail.com
It comes back after a few seconds/minutes (depending on your box). Meanwhile it's maxing out the CPU.
Jul 9, 2010
#3 thierry....@gmail.com
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
CODE:
package com.example.helloandroid;

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


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

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?

thanks
Jul 31, 2010
#4 christop...@gmail.com
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
#5 antonio....@gmail.com
Change Eclipse version to 3.5.2 and install last ATD plugin :)
Oct 10, 2010
#6 defav...@gmail.com
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
#7 snp...@gmail.com
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/
Oct 31, 2010
#8 j...@thesquareplanet.com
For those of you with this problem, here's what you can do until the fix is publicly available:
1. Download "http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=<branch>;sf=tgz" where <branch> is one of those listed here (froyo for 2.2, the file is about 113MB): http://android.git.kernel.org/?p=platform/frameworks/base.git;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
#9 vekexa...@gmail.com
Thanks @jongjengset :)
Nov 30, 2010
#10 dh1...@gmail.com
Thanks jongjengset, that worked like a charm.
Dec 16, 2010
#11 seneg...@gmail.com
@jongjengset "Flawless Victory !!!" :D Thx man .. saved me a lot of time :)
Dec 18, 2010
#12 piscopo....@gmail.com
@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
#13 ubuntudr...@gmail.com
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
#14 baz8...@gmail.com
@jongjengset, thanks.  Works for me too.
Dec 25, 2010
#15 ken...@gmail.com
@jongjengset, works for me, verified on Froyo & Gingerbread, thanks !
Jan 2, 2011
#16 starwhis...@gmail.com
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
#17 vanstr...@gmail.com
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
#18 futonred...@gmail.com
This still happens with ADT 0.9 - preview 3. The 8.0 versions have it as well.
Jan 13, 2011
#19 francesc...@gmail.com
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 :)
http://tools.android.com/download


Jan 17, 2011
#20 snp...@gmail.com
There is bug in Eclipse related to Javadoc attachment. You can take a look at http://groups.google.com/group/android-developers/msg/0f9d2a852e661cba
Jan 30, 2011
#21 mattcmic...@googlemail.com
Cheers @jongjengset!
Feb 1, 2011
#22 ena1...@gmail.com
@jongjengset Thank you!!! :) It was really annoying.
Feb 4, 2011
#23 frederik...@gmail.com
@jongjengset I'm very happy now :) Thank you!
Feb 6, 2011
#24 nfar...@gmail.com
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
#25 jairot...@gmail.com
try to follow jongjeng but need git.
download git? install git? learn how git works?
man too much work ...
Feb 12, 2011
#26 carl.fle...@gmail.com
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
#27 nfar...@gmail.com
You don't need to understand git, it's just a link that generates an archive from a git repo automatically.
Feb 15, 2011
#28 whydoiha...@gmail.com
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
#30 deck...@gmail.com
Thank you! Worked like a charm :)
Feb 21, 2011
#31 ropa...@gmail.com
Like a charm.  Thank you!!
Mar 3, 2011
#32 bergze...@gmail.com
works like a charm. but this is still a temporary fix.
when will ADP get an official bugfix for this?
Mar 11, 2011
#33 erik.ox...@gmail.com
Adding empty "sources" directorties as suggested in comment "Comment 19 by francesc...@gmail.com, Jan 13, 2011" is by far the simplest solution. Worked for me! :-)
Aug 7, 2011
#34 coud...@gmail.com
#19 don't work for me. Any other suggestion ? 
Dec 22, 2011
#35 scottd.n...@gmail.com
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
#36 diego.su...@gmail.com
Yepp, confirming this is still happening with Ubuntu 10.10 64bit, Eclipse 3.7.
Feb 24, 2012
#37 ayyakara...@gmail.com
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
#38 bentalbo...@gmail.com
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
#39 gandhi.p...@gmail.com
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 tnor...@google.com
Sorry, this bug wasn't filed in the tools category, so we hadn't seen it. I'll investigate now.
Status: Assigned
Owner: tnor...@google.com
Labels: Component-Tools
Jul 25, 2012
#42 tor.nor...@gmail.com
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
#43 tor.nor...@gmail.com
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(OS.java:14884)
        at org.eclipse.swt.graphics.TextLayout.getLineBounds(TextLayout.java:1123)
        at org.eclipse.jface.internal.text.html.BrowserInformationControl.computeSizeHint(BrowserInformationControl.java:453)
        at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1204)
        at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1150)
        at org.eclipse.jface.text.AbstractInformationControlManager.setInformation(AbstractInformationControlManager.java:418)
        at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:533)
        at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:1131)
        at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:1121)
        at org.eclipse.jface.text.contentassist.AdditionalInfoController.showInformation(AdditionalInfoController.java:517)
        at org.eclipse.jface.text.contentassist.AdditionalInfoController$10.showInformation(AdditionalInfoController.java:462)
        at org.eclipse.jface.text.contentassist.AdditionalInfoController$9.run(AdditionalInfoController.java:342)
        - locked <0x00000000df3fbeb8> (a org.eclipse.jface.text.contentassist.AdditionalInfoController$10)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)

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

Powered by Google Project Hosting