Build time is too long

I have a problem with my android project build time. After I updated to new Xamarin.Android.Support nuget packages build time increased in several times. My solution contains
1.PCL core logic project
2. Shared android library project
3. Android phone library project
4. Android tablet library project
5. Main enter point android app project that have references to all projects above.

My packages included in every project

<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Microsoft.Bcl" version="1.1.10" targetFramework="MonoAndroid50" /> <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="MonoAndroid50" /> <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="MonoAndroid50" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="MonoAndroid60" /> <package id="PCLCrypto" version="2.0.147" targetFramework="MonoAndroid60" /> <package id="PInvoke.BCrypt" version="0.3.152" targetFramework="monoandroid70" /> <package id="PInvoke.Kernel32" version="0.3.152" targetFramework="monoandroid70" /> <package id="PInvoke.NCrypt" version="0.3.152" targetFramework="monoandroid70" /> <package id="PInvoke.Windows.Core" version="0.3.152" targetFramework="monoandroid70" /> <package id="SQLite.Net.Async-PCL" version="3.1.1" targetFramework="MonoAndroid50" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="monoandroid70" /> <package id="SQLite.Net.Platform.XamarinAndroid" version="2.5.1" targetFramework="MonoAndroid41" /> <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="MonoAndroid50" /> <package id="Validation" version="2.3.7" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Compat" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Core.UI" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Core.Utils" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Fragment" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Media.Compat" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.v4" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.v7.AppCompat" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.Android.Support.Vector.Drawable" version="24.2.1" targetFramework="monoandroid70" /> <package id="Xamarin.GooglePlayServices.Base" version="29.0.0.2" targetFramework="monoandroid70" /> <package id="Xamarin.GooglePlayServices.Basement" version="29.0.0.2" targetFramework="monoandroid70" /> <package id="Xamarin.GooglePlayServices.Maps" version="29.0.0.2" targetFramework="monoandroid70" /> <package id="Xamarin.Insights" version="1.12.3" targetFramework="monoandroid70" /> <package id="ZXing.Net.Mobile" version="2.1.47" targetFramework="monoandroid70" /> </packages>

Before updating to new support packages all was fine. Build time was about 40 secs. Okey, I can understand we my rebuild time now is about 5 mins. But when I debug and change just one line of code I wait the same 5 minutes. Moreover now I need to enable multi-dex for my project otherwise I have a build error.

There is a build log

Target perfomance summary:
     0,102 ms  _AddAndroidEnvironmentToCompile                         1 calls
     7,964 ms  _AddCorlibReference                                     1 calls
    88,204 ms  _AddLibraryProjectsEmbeddedResourceToProject            1 calls
     0,150 ms  _AddMultiDexDependencyJars                              1 calls
     0,109 ms  _AddNativeLibraryArchiveToCompile                       1 calls
105222,884 ms  _BuildAdditionalResourcesCache                          1 calls
   119,809 ms  _BuildLibraryImportsCache                               1 calls
     1,751 ms  _BuildSdkCache                                          2 calls
     2,159 ms  _CalculateAdditionalResourceCacheDirectories            1 calls
     1,421 ms  _CheckDuplicateJavaLibraries                            1 calls
     0,069 ms  _CheckForContent                                        1 calls
     0,259 ms  _CheckForDeletedResourceFile                            1 calls
     0,282 ms  _CheckForInvalidConfigurationAndPlatform                1 calls
     0,069 ms  _CheckTargetFramework                                   1 calls
   235,175 ms  _CollectAdditionalResourceFiles                         1 calls
    16,578 ms  _CollectMonoAndroidOutputs                              1 calls
     0,589 ms  _ComputeAndroidAssetsPaths                              1 calls
    29,293 ms  _ComputeAndroidResourcePaths                            1 calls
     0,339 ms  _CopyAppConfigFile                                      1 calls
     1,728 ms  _CreateAdditionalResourceCache                          1 calls
     0,459 ms  _CreatePropertiesCache                                  1 calls
     1,352 ms  _ExtractLibraryProjectImports                           1 calls
     0,601 ms  _GenerateAndroidAssetsDir                               1 calls
     8,707 ms  _GenerateAndroidResourceDir                             1 calls
    40,400 ms  _GenerateJavaDesignerForComponent                       1 calls
     3,638 ms  _GenerateTargetFrameworkMonikerAttribute                1 calls
     8,411 ms  _GetAdditionalResourcesFromAssemblies                   1 calls
     0,654 ms  _GetCompileOutputsForClean                              1 calls
     2,814 ms  _GetLibraryImports                                      1 calls
     1,625 ms  _GetReferenceAssemblyPaths                              2 calls
     1,277 ms  _ReadPropertiesCache                                    1 calls
    35,607 ms  _RecordCleanFile                                        1 calls
   269,846 ms  _ResolveLibraryProjectImports                           1 calls
    12,087 ms  _ResolveMonoAndroidSdks                                 2 calls
     1,038 ms  _SeparateAppExtensionReferences                         2 calls
   220,748 ms  _SetLatestTargetFrameworkVersion                        2 calls
     0,180 ms  _SetupApplicationJavaClass                              1 calls
     0,072 ms  _SetupDesignTimeBuildForBuild                           1 calls
     1,694 ms  _SetupInstantRun                                        1 calls
  2991,123 ms  _UpdateAndroidResgen                                    1 calls
     1,718 ms  _ValidateAndroidPackageProperties                       1 calls
     0,110 ms  _ValidateLinkMode                                       1 calls
     1,556 ms  _ValidateResourceCache                                  1 calls
     0,288 ms  AssignLinkMetadata                                      2 calls
   547,584 ms  AssignProjectConfiguration                              3 calls
     3,548 ms  AssignTargetPaths                                       4 calls
     1,646 ms  BclBuildAddProjectReferenceProperties                   3 calls
     0,026 ms  BclBuildSetRunningFullBuild                             1 calls
     3,625 ms  BclBuildValidateNugetPackageReferences                  3 calls
    30,746 ms  CopyFilesMarkedCopyLocal                                1 calls
     1,172 ms  CopyNonResxEmbeddedResources                            1 calls
  1250,224 ms  CoreCompile                                             1 calls
     0,480 ms  CreateManifestResourceNames                             1 calls
     2,866 ms  DeployOutputFiles                                       1 calls
     0,164 ms  GenerateResources                                       1 calls
     0,069 ms  GenerateSatelliteAssemblies                             1 calls
     3,616 ms  GenerateTargetFrameworkMonikerAttribute                 1 calls
  1313,510 ms  GetCopyToOutputDirectoryItems                           4 calls
    64,207 ms  GetReferenceAssemblyPaths                               2 calls
   115,786 ms  ImplicitlyExpandDesignTimeFacades                       1 calls
     2,013 ms  PrepareForBuild                                         2 calls
     0,097 ms  ProcessGoogleServicesJsonChecks                         1 calls
    74,868 ms  ResolveAssemblyReferences                               1 calls
   548,496 ms  ResolveProjectReferences                                1 calls
     5,147 ms  SplitProjectReferencesByExistent                        4 calls
     0,925 ms  SplitResourcesByCulture                                 1 calls
Tasks perfomance summary:
  2194,777 ms  Aapt                                                    1 calls
    29,551 ms  AndroidComputeResPaths                                  2 calls
     0,184 ms  AssignCulture                                           1 calls
     2,977 ms  AssignProjectConfiguration                              3 calls
     3,060 ms  AssignTargetPath                                       12 calls
     1,173 ms  CalculateAdditionalResourceCacheDirectories             1 calls
     1,329 ms  CheckDuplicateJavaLibraries                             1 calls
   493,301 ms  ConvertResourcesCases                                   1 calls
    33,976 ms  Copy                                                    5 calls
   115,934 ms  CopyGeneratedJavaResourceClasses                        1 calls
    11,450 ms  CopyIfChanged                                           1 calls
     4,158 ms  CreateAndroidResourceStamp                              1 calls
     0,260 ms  CreateCSharpManifestResourceName                        1 calls
   266,825 ms  CreateItem                                             37 calls
    87,730 ms  CreateManagedLibraryResourceArchive                     1 calls
     8,793 ms  CreateProperty                                         77 calls
     3,851 ms  CreateResgenManifest                                    1 calls
     1,045 ms  CreateTemporaryDirectory                                1 calls
  1236,062 ms  Csc                                                     1 calls
     0,658 ms  FindAppConfigFile                                       2 calls
     7,697 ms  FindUnderPath                                           1 calls
   131,085 ms  GenerateResourceDesigner                                1 calls
105210,640 ms  GetAdditionalResourcesFromAssemblies                    1 calls
     1,052 ms  GetAndroidDefineConstants                               2 calls
     0,498 ms  GetAndroidPackageName                                   1 calls
     1,184 ms  GetAppSettingsDirectory                                 2 calls
    13,026 ms  GetExtraPackages                                        1 calls
   110,311 ms  GetImportedLibraries                                    1 calls
     0,538 ms  GetJavaPlatformJar                                      1 calls
     9,831 ms  GetReferenceAssemblyPaths                               4 calls
     0,962 ms  MakeDir                                                 4 calls
     3,261 ms  Message                                                22 calls
  1856,999 ms  MSBuild                                                 4 calls
     2,565 ms  ReadAdditionalResourcesFromAssemblyCache                2 calls
     1,364 ms  ReadImportedLibrariesCache                              1 calls
     1,290 ms  ReadLibraryProjectImportsCache                          1 calls
     6,107 ms  ReadLinesFromFile                                       2 calls
   218,320 ms  ReadResolvedSdksCache                                   2 calls
     7,920 ms  RemoveDirFixed                                          1 calls
    21,457 ms  RemoveDuplicates                                        1 calls
    71,525 ms  ResolveAssemblyReference                                1 calls
   258,873 ms  ResolveLibraryProjectImports                            1 calls
     1,988 ms  ValidatePackageReferences                               3 calls
     1,220 ms  WriteLinesToFile                                        1 calls
Build succeeded.
Warnings:

     8 Warning(s)
     0 Error(s)
Time Elapsed 00:01:52.9911750

Please help me understand were the problem and how can I solve it.

Posts

Sign In or Register to comment.