Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Xamarin.Android rebuilds entire solution upon run?

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.

like image 651
Aneri Avatar asked Oct 21 '22 02:10

Aneri


2 Answers

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 :-)

like image 78
jstedfast Avatar answered Oct 24 '22 04:10

jstedfast


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.

like image 24
Cheesebaron Avatar answered Oct 24 '22 04:10

Cheesebaron