Xamarin.Android build time about 30 seconds, is it normal?

Xamarin.Android with Xamarin.Forms views is building in about 30 seconds is it normal or usual time?

More details:

  • Projects (Xamarin.Forms and Xamarin.Android) are the template ones in Visual Studio, and no additional code is added, only packages that are required for Xamarin.Android's project
  • java.exe is generally high on CPU usage 45-60%, while the android project is being built

From detailed diagnostics while building the project I got these as highest time consuming calls:

        Target Performance Summary:
        1. 13808 ms _CompileToDalvikWithDx                     1 calls
        2.  3490 ms _CompileJava                               1 calls
        3.  1828 ms _GenerateJavaDesignerForComponent          1 calls
        Task Performance Summary:
        1. 13555 ms CompileToDalvik                            1 calls
        2.  3490 ms Javac                                      1 calls
        3.  3116 ms Aapt                                       3 calls

I do not want to argue for the slowness, but rather I want to know if it is normal or I should modify some settings or stuff.
Also just to know, these times are generated from doing debug REbuild on Xamarin.Android's project

Posts

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    This is fairly normal for a Xamarin.Android application that includes Xamarin.Forms and all of the respective support libraries. As you can see in your Performance Summary, we are seeing roughly 3s for resource parsing(aapt), 3s for java compilation (javac) and about 14s for dex compilation.

    If you want to dig into this further, you can use a Diagnostic Build Output and manually invoke these commands on the command line and see how long they take each. Majority of this is work being done by the Android SDK build tooling which is somewhat a bottleneck.

    There are also some great tips in the following Android Studio documentation that can be applied to Xamarin.Android projects as well:

    https://developer.android.com/studio/build/optimize-your-build.html

    This is an area we are focused on improving in the future as well. If you have any questions, feel free to reach out!

Sign In or Register to comment.