Building workspace is taking a lifetime - android

I'm developing a game that has a lot of drawables. Now I'm designing the levels, and it makes me refresh my project very often after making minor changes. And every time workspace is building very slowly, it makes me lose very much time on just waiting for it to build. Are there any hints on making it faster? Or how can I disable rebuilding of all those resources that do not change from build to build? Thanks in advance.

Depending on your environment and version of eclipse, it could be setup to use a small amount of memory on start up. Try tweaking the memory you use and see if that helps. You can do this by starting it from the command line or editing the .ini file (on windows). This blog post touches upon it: http://blog.xam.dk/?p=58

you can disable "Build automatically" in "Project" then you can manually build your app after your changes by "Build project".

Related

Android Studio freezes when changing a source file

I really need some help with this.
I had to migrate from Eclipse to Android Studio.
I exported my project (at first time - using "export" tool, at the second time manually - same result) and everything worked great (I worked for 2 days successfully) before I tried to make an apk-file. While making an apk-file, AStudio was complaining about some things like "change your customNS to res-auto" and when I did so, it started to freeze. If it freezes it's over, I have to kill the process of AS. When I reload AS, it makes a rebuild and then deadly freezes again. I figured, the build itself doesn't hang the AS, it freezes when I try to interact with source files. Try to print just a single letter - and it's over.
I ran this project on my friend's laptop (it's more powerful than mine) and it doesn't freeze there. But I'm not sure it's really connected with the power of PC.
Please give me some advice. Thanks.
So, problem solved. I had in my file some if-else-if structure with about 50 conditions. Refactoring it solved the freezing problem.
That's probably AStudio's way of punishing those who write bad code :)

How to avoid the "User Operation is Waiting" dialog come out in Eclipse/ADT

As shown in the image, when I'm developing Android applications with auto build, sometimes this dialog will show. Is there any way to avoid this and make it just go through the process in the background?
It does not always show, but when it does, I need to wait for it for 5-10 seconds. That's annoying, especially considering that when the project gets bigger, it will go much slower.
UPDATED:
I did some researching:
Android compilation is slow (using Eclipse)
Android: eclipse workspace takes a long time to build?
http://groups.google.com/group/android-developers/browse_thread/thread/a16202975510de39
http://oae9.wordpress.com/2011/03/22/android-workaround-for-slow-building-workspace-problem-in-eclipse/
http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html
Is it there any easier solution that is not using ANT?
Or any other best ANT script that can be applied easily?
How about you just uncheck the "Build Automatically" option. This doesn't speed the build process, but doesn't do it everytime you save a file.
You will still need to do a build that takes a bit of time - but you will only do it when you really want to compile your project (not everytime you make a change to the code).

android project not getting built

I am a newbie to Android development, and am using Eclipse 3.7 Indigo on Ubuntu 11.10. I have the SDK and the ADT installed. I have two problems.
An Android project takes an awfully long time to get created.
When I restart Eclipse, all previously built Projects (even simple Hello World ones) have to be rebuilt, and this takes a really long time to build. While building the "details" dialog box shows
Loading data for Android 2.3.3
Android 2.3.3: Widgets and Layouts
then,
Building Workspace (where the progress bar seems to remain halted for eternity). At times it gets built after this. At other times, the first line in the HelloAndroid.java file shows an error, which when rebuilt yet again disappears.
So when I restart Eclipse, it takes approximately 10 minutes to get previously built projects running on the Emulator.
Any fixes to this?
Hard telling what the issue is without more information, but here are some thoughts:
Your machine may be underpowered. What OS, processor speed, RAM do you have?
If you have a very large amount of projects, or have some very large projects, then it can take a long time to build them when Eclipse starts. You can close a project (right-click the project in Package Explorer and click Close Project) so it will not be built and is not accessible until you open it later. Close projects you aren't actively working on, but may want to use again someday in the future.
The ADV (emulator) takes a long, long time to start up, yes. When you start it, make sure to select the option to start from snapshot and save to snapshot to save time starting it in the future.
And yes, you may want to reinstall everything again. Sometimes Eclipse just gets screwy.
It sounds like any of several items were improperly installed. Consequently, the directories of where your compiled libraries can't be found and must be regenerated each time. That is why it takes ten minutes or more: you're recompiling everything!
The time it will take for you to track everything down and repair the settings will be MUCH longer than the time to just do a fresh install.
Really.

Quick Build In Android with eclipse

I have a android project which is huge in size with more than 100 resource files, layouts and lot of codes. It takes about a minute and even more to completely build. Even when I change a single line or just give a space the whole project takes 1 minute to build. But I want it to consider only the changes and build quickly when there is very less change. Is there a way to do it. Any kind of help is appreciated. Thank you.
as long as I know partial builds are not possible. You can disable the "Build Automatically" (not 100% sure about the name, I don't have Eclipse open right now) option from Eclipse and start the build manually.
Could you comment out or just run the classes that have changed by themselves? I guess maybe this is one of the reasons they push encapsulation so much with object oriented programming.

Eclipse hangs when trying to add menu.xml

I've recently starting developing with the android sdk. Currently, I am trying to add code to use a menu, however, when I try to add a menu.xml under res/menu, Eclipse hangs and freezes every time. When I reopen the Eclipse, menu.xml is there, but every time I try to open it, Eclipse hangs and freezes again.
I am running on OS X Snow Leopard, Eclipse 3.6.2 and the latest android sdk and adt plugin.
Any help, insight, thoughts?? I am thoroughly stuck.
Thanks.
Dustin
Thanks for the input guys. What ended up working for me was instead of trying to manually create a new menu.xml file, I find the add android .xml wizard and using it instead allowed me to add whatever I needed with out any hang ups.
Same problem happens for me even under the latest version of Eclipse (Helios). If I wait long enough, Eclipse reports a stack overflow exception and then this shows up in the Output window:
W/ResourceType( 5124): Bad XML block: header size 0 or total size 9949440 is larger than data size 0
menu.xml:1: error: Error parsing XML: no element found
This indicates that the XML parser isn't handling empty documents and the Android menu editor is barfing on the newly created file while trying to open it. I'm sure there is some "standard" way of creating a new menu that doesn't break the IDE but I have no idea what that method is. I'm too used to editing my files by hand but this crash/hang bug is a serious nuisance.
Dustin,
I think what has happened is, your settings have become corrupt. I highly recommend resetting all your settings. Keep in mind, you will have to re-import all your projects so this can be quite a pain, but I really think this will fix your problem.
To start, find your workspace folder and rename it to something like "workspace-bad"
Then, create an empty workspace folder to replace the one you just renamed.
Lastly, open eclipse and it will act just like a brand-new installation.
You will need to re-import your projects, which can be done by going to eclipse, hitting File>Import...
Then select under General
"Existing Projects into Workspace"
then hit "Next" and then hit "Browse" to find the root directory
also make sure "Copy project into workspace" is checked
I also recommend doing your "problem project" first, that way you don't waste your time doing the rest and then find out you have to re-create it.
I'm hoping that fixes it for you, good luck! :-)
-Jared
I ran into the same issue with the same setup. Right clicking menu.xml, selecting 'Open With', and selecting Xml Editor seemed to be a viable workaround for me.

Categories

Resources