Reputation: 5174
I have a relatively small project (50 classes) that has included 13 JAR libraries (android-support, gson, guava etc) and uses one Android library (Sherlock).
The problem is that whenever I press "Build Project" it takes around two minutes to build/deploy to a device. (However newly created android project takes no more than 5 seconds to build).
Is there something I can do with it (limit number of libs, switch to another IDE)? Or it is just usual behavior.
Upvotes: 0
Views: 1415
Reputation: 14472
AlexR has a good answer. To add:
I use IDEA so I don't know how to do this in Eclipse but I know it can be done - probably right click context menu.
Exclude any layouts that you don't really need for dev/test from your build. I tend to put placeholder layouts in early in a project then refine them later in the project when the main code is getting to alpha quality. I exclude everything except one set, e,g. "normal" portrait, do all of my code creation then only add the layouts back in near the end.
Same goes for assets. Do you have a lot of assets or assets of large size? Exclude these, or perhaps temporarily replace with smaller ones.
All this said, the compilers used do a very good job of optimisation and as the number of classes grows, it is inevitable that your build time will increase. It's not exponential (I've never actually measured it) but it's certainly worse than linear.
Upvotes: 1
Reputation: 9730
The project takes that long to compile because it needs to add the JAR files and Sherlock library. Every library added to the project will increase the build time of the project.
Switching to another IDE would not make a huge difference because a lot of the building is handled by the Android SDK.
Your best bet would probably be to limit the libraries of your project using elimination to see which causes the largest build time increase.
Upvotes: 1
Reputation: 115328
I do not have direct answer to your question but I can recommend you the following steps.
Good luck.
Upvotes: 0