I have a project in Android Studio which has two libraries linked. The Google Downloader and the Licencing library. Every time I want to run the app on a device it takes more than to 1 minute.
I have a gut feeling that the libraries are compiled every time, even if I haven't changed it.
Can anyone confirm this? And if it is so, is there anything I can do to speed up the process?
Found another thread which describes the same issue. I might update Gradle etc.
Building and running app via Gradle and Android Studio is slower than via Eclipse
Related
So a couple of days ago, I decided to start android programming using Android studio. After installing the IDE I had some problems syncing Gradle (discussed here). Now I'm trying to use Android studio without Gradle. I've read some topics about using Ant etc. but I don't know which one is the easiest way to do that, And most of them weren't talking about Android studio.(note that I want to use Android studio and build/debug apps normally, just like someone who uses Gradle)
Gradle is the build system for Android. Android Studio uses it for all its builds. You can't build without using Gradle. There were alternative build systems years ago, but they stopped being supported almost a decade ago now. While it would be technically possible to build without gradle, you'd be doing months of work to get a basic build up and running because you'd have to rewrite EVERYTHING google's build does using the alternative system.
Basically you can spend a few days figuring out how to fix your gradle setup (which will almost certainly end up being trivial) or you can spend the next year writing a build system. Pick the first option.
I'm currently working on a project and it take up to 1 min for Android Studio to build it. Yesterday I was working without Internet connection and it turned out that it needed only 30s for AS to buid the project.
What is the reason? Does it mean that the building process check something online each time it builds? Is there any way to change that?
My project has 2 submodules and I would avoid them to be built each time I build the project as nothing as changed. Is there a way to do that?
Best way to speed up ,is to use instant run feature and make sure you have Android Studio 2.3 and higher to support this feature.
Follow this link to you instant run
https://developer.android.com/studio/run/index.html
I am working on an Android Project which makes use of the NDK and binds the rather large Boost C++ library. Upon every startup of Android Studio, the IDE takes a rather long time of about 1 hour (more or less, on an i7 quad-core machine) during the Building Symbols stage, during which it is effectively impossible to use the IDE. I guess the bottleneck is directly related to the huge number of symbols included in Boost.
Is there a known remedy to this problem? I have not seen many complaints about this problem, but this forum post seems to ask for help for the same issue: https://forum.xda-developers.com/tools/android-studio/android-studio-2-2-add-cpp-files-using-t3499634
I am facing the exact same issue - after upgrading my Android Studio installation to 2.3.3 yesterday, opening my project now faces me with at least 30 mins of "building symbols" at which point the IDE is effectively useless.
I can build the project via gradle commands in terminal, so I have no idea why this step is mandatory in AS.
I read that this may have something to do with using the NDK build (Android.mk?) vs. CMake (CMakeLists.txt), but I have not yet been able to convert over my .mk file to test this out. This is a legacy project, and the NDK portion is still somewhat of a mystery to me :(
I am using Xamarin Studio with Xamarin.iOS and Xamarin.Android. My workspace contains two solutions, one for android, another for ios. Projects are pretty much the same. When I build the solution for ios, it rebuilds only changed projects. It does some additional operations which take really little time. So pressing Build second time takes virtually no time.
But when I build the Android solution, it rebuilds all projects regardless of changes in files, configuration and so on. If I press Build after successful build, it rebuilds it all over again. Even worse, if I try to Run a just built project, it rebuilds it! Furthermore, if I run the project after run (when you debug a program, it happens often), it rebuilds it again. As I have many projects, it takes really long time, plus the compilation is very CPU-dependant, so improving speed is hard.
Generally, the question is if it is possible not to rebuild entire solution upon every build? Maybe there is a configuration option I am missing, or something is misconfigured?
I don't know if anything in projects configuration is relevant to the question, so please tell me what part of solution/projects configuration may help.
Versions:
Xamarin Studio
Version 4.0.9 (build 12)
Xamarin.Android
Version: 4.7.11 (Business Edition)
//I thought that separate compilation nowadays is a must in every serious compiler, so I assume, I have done something wrong.
UPD:
I have installed latest versions of Xamarin Studio and Xamarin.Android:
Xamarin Studio
Version 4.0.12 (build 3)
Xamarin.Android
Version: 4.8.1 (Business Edition)
It takes 1 minute 58 seconds to rebuild the android solution. Every time when I run the application.
Honestly, this sounds like a bug in Xamarin Studio or the xbuild build tool, at least, assuming you don't have any custom build steps (which you probably don't)? Could you file a bug report on https://bugzilla.xamarin.com? Thanks! It really shouldn't rebuild the project each time.
I'm really happy to hear that your iOS project doesn't rebuild, though, because I'm the maintainer of the iOS build code :-)
I would think the reason for complete rebuild, when you want to run is because an APK file is not generated when just rebuilding. It is first generated when wanting to either deploy or run the project.
It's not a bug, I have the same features, and I have wasted lost of time waiting for each run in debug mode. I think using Xamarin has cost me 10x more time than using any other development environnement cause of tons of problems like this...
It's an unprofessional tool.
When we first started developing for android, we had 2 projects:
One for the 'core' functionality, other for the 'business' functionality.
So far so good, we went through bad times waiting so much time for compilation of XML changes, but life was still quite bearable.
After some time, we evolved (or not) to come with 9 projects. For some projects, we have a 'test' project.
We also have some library projects, for instance, we have two different projects for different versions of android, and we have a 'shared' project for shared configs or controllers.
The reason for that is because our application is quite big.
When we make some changes on the core project, we usually have to recompile, and 'clean' the workspace with eclipse. Also, we usually have to use the 'Build Project' option a few times for the projects to update their references, the first build hardly compiles everything, we call this in our team 'COMBO', which is the combination of 'F5' and 'CTRL+B' to compile the projects.
All this setup is killing a lot of time and making developers sad, like, a team of 6 developers :(
I know that by this time we should pretty much know all the issues and the best options, but I can't believe the way it is. And after so many time searching and trying to improve, we can't seem to find other solutions to improve development time with android.
Our set of tools is:
Eclipse 4.2.1
ADT 21.1.0
Eclipse Colour Themes (for a cute code)
SDK always updated
Hardware:
Windows 7 Professional 64 bits
8 GB RAM
Intel Core i5-3470 3.20GHz
I would love answers about:
Compilation time improvement: Did you found any IDE that for YOU it was faster than eclipse? Why? How was the setup? What are the drawbacks of using ADT and how can I improve performance with it, while using multiple projects?
Project references management, is there any suggestion on how
to speed up build? Should I put the whole source code in a single project?
Any way to speed up development when you have the device and need to deploy it while testing the application?
Try Intellij.
In the latest version, 12, they made project build improvements that make it much faster than 11 and Eclipse.
Parallelization
Note also the third column, called Parallelized. This
is a new compiler option which allows you to use more than one core
for building a project. In this case the compiler runs for multiple
independent project modules in parallel. Since each compiler thread
uses file system, the benefit of parallelizing highly depends on how
fast you hard drive is. Still the average gain in performance is
spread between 10 and 20 percent for large projects.
Automatic Make
One more exciting compiler option added in IntelliJ
IDEA 12 is automatic make. This is another time-saver, which triggers
project make automatically on every change. Since the compiler runs in
a separate process, it is able to compile modified files in the
background, while you are doing something else. This means your
project is in compiled state all the time, so you don’t need to wait
any time you want to run it.
http://blogs.jetbrains.com/idea/tag/brand-new-compiler/
Also if you are using git for version control I have noticed Intellij is much better at updating after I switch branches. It integrates well with git and notices that you switched branches and refreshes and cleans out the project in the background automatically, while on Eclipse you might have to refresh and clean manually.