Eclipse problems when adding layoutlib.jar to a project

by Lars » Fri, 06 Mar 2009 05:19:28 GMT

Sponsored Links

I need to use the IWindowManager classes et al that resides in the
layoutlib.jar file and have added it to my project in Eclipse (3.4.2)
as an external Jar. After doing this, Eclipse utilizes 100% CPU (very
slow, almost hung) and is unusable when Eclipse tries to build the
project. Sometimes I get it to create the classes,dex file but most of
the time I have to kill the IDE. Also, the dex-file is very large
(around 4MB, when it gets created at all). If I remove layoutlib.jar
the project builds normally.

1. How do I use the layoutlib.jar file in my project?
2. How do I prevent the classes.dex file to contain a copy of
layoutlib.jar? I assume I don't need the jar file when running the
program on the device, or?

I use SDK 1.1_r1

Thanks in advance,


Eclipse problems when adding layoutlib.jar to a project

by Lars » Fri, 06 Mar 2009 15:46:52 GMT

 I have found the solution myself. These jar files should be added as a
"User Library". Right click the project in Eclipse, select "Build
Path" and then "Add Library". Select "User Library" and add the jar
file there.

Lars Brange


Sponsored Links

Other Threads

1. Activity saved state not always working?

I've got a TextView which keeps losing it's previous value between intent
invocations. If I enter some text, hit the home button then relaunch the app
the text is restored as expected. If I change orientation, onCreate fires
and again text is restored as expected. However if I navigate elsewhere in
the app via menu option then navigate BACK to the original screen via the
menu, onCreate receives null for the incoming Bundle and my TextView loses
state. I can see onSaveInstanceState being called before navigating away so
I'm scratching my head as to what's going on.

Menu option is firing an intent like so:
intent = new Intent( Constants.INTENT_FORM_LIST );
startActivity( intent );



2. "back" button when in ListActivity causes runtime exception

There is probably more to your stack trace than this. Usually stack
traces have an exception, for example.

Continue reading your stack trace. Look for the "Caused by:" line to
find out the actual exception.

Mark Murphy (a Commons Guy)
 http://www.***.com/  |  http://www.***.com/ 
 http://www.***.com/ |  http://www.***.com/ 

Android Training...At Your Office:  http://www.***.com/ 


3. Can't compile AOSP full_sapphire-userdebug/eng

4. App to communicate over the phone USB port

5. Clicking in an AppWidget

6. App to communicate over the phone USB port

7. Possible to hang help/hint bubbles off views?