Slow build and deployment time when referencing Android.Support.v7.AppCompat and GooglePlayService

I'm trying to port some small Windows Mobile application to Android using VS2010 & xamarin plugin.
The solution consists of 3 projects, each containing layout files. There are some 20 layouts in total.
I created a binding and referenced DragSortListView.jar and added XamarinMobile to use the Camera functionality.
Everything was fine till the moment I needed to port the GPS & location functionality - I needed to import GooglePlayService library.
Then a requirement came to use ActionBar, so I needed to reference Xamarin.Android.Support.v4 and Xamarin.Android.Support.v7.AppCompat.
Now I find that it takes more than a minute to run a debug session on a Samsung Galaxy Note.
I've played with "Use fast deployment" option to no avail...
Then I unchecked "deploy" option in solution configuration and noticed that deployment time was greatly reduced. (build time was the same)
I was happy for half an hour just to find out this:
The changes to the application are not uploaded to the device and I'm debugging older versions.

I've read also that using layouts in referenced libraries could greatly increase build time:

So I merged all my projects into single one.

Again, changing only the executable project, not the referenced one, causes a rebuild which takes more than a minute.
I'm running on a desktop PC with pretty decent specs: i7 16GbRAM with SSD drives.

Is this normal or I can do something?


  • LucaFongaroLucaFongaro USMember ✭✭

    I have the same problem too. I use Xamarin.Android.Support.v7, my app take about 2-3 minute to deploy (I use VS2012 and Nexus 7 2012. Xamarin.Android is up to date). It's very frustrating.

  • ThomasFlemmingThomasFlemming DEMember ✭✭

    I have the same problem, takes very long to compile, seems to be in conection with GooglePlayService library.

  • The same problem here

  • DanielVartdalDanielVartdal USMember ✭✭
    edited August 2015

    Still the same problem here. Small changes in GUI or refrerenced projects (for instance PCL) triggers re-build of solution.

    Around two minutes is the "magic number" for build times.. Have also sent mail to Xamarin, but they haven't got any solution for this as I've heard..

    I've also referenced the APPCompat components for the menu and status-bar, and have had a hinch that this has caused the slow build times..

    Did you find a solution for this @ThomasFlemming @MichalDobrodenka @LucaFongaro @bozokosmev

    Edit: I made a new project. And it seems like my problem is the amount of Resources/Images in my solution, not the AppCompat references.

  • ThomasFlemmingThomasFlemming DEMember ✭✭

    Are you still using VS2010? I must say, that vs2015 is really running nice, Xamarin is already included in the MS-setup and up to now I didn't encounter any problems. But, I also don't use GooglePlayService anymore.

  • DanielVartdalDanielVartdal USMember ✭✭

    I do have to re-evaluate what made the slow build times. For me it came down to the amount of resource-files I had in my project (around 2000)

    After e-mailing Xamarin support, they finally came up with a solution.

    Putting this propertygroup in the Xamarin Android project:

            <AndroidExplicitCrunch>true</AndroidExplicitCrunch >

    Made my day!

    Build times went from 2 minutes to 30 seconds on re-build of the project (triggered by xml updates etc)

  • @DanielVartdal Thanks for posting your solution. This solved my problem- thanks a bunch I was so frustrated.

  • DanielVartdalDanielVartdal USMember ✭✭

    @PatrickMillard Perfect! Glad it helped :)

  • aquabayaquabay AUMember ✭✭

    @DanielVartdal For those who want to know what thsi does:

    AndroidExplicitCrunch – If you are building an app with a very large number of local drawables, an initial build (or rebuild) can take minutes to complete. To speed up the build process, try including this property and setting it to True. When this property is set, the build process pre-crunches the .png files.

Sign In or Register to comment.