Bug 52614 - Resources generation task (aapt process) is blocking operation.
Summary: Resources generation task (aapt process) is blocking operation.
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: 4.3.0 (C9)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-02-18 10:53 UTC by Przemysław Raciborski
Modified: 2017-02-24 13:07 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Przemysław Raciborski 2017-02-18 10:53:25 UTC
In Xamarin Studio when Resources are regenerated (aapt process is run) everything is fine - we can modify source code, explore options and so on.. (this does not block on UI thread)
On Visual Studio when resources regenerates everything hangs out - we can't do anything. We can only look at task manager and see that aapt process is spawn after every X seconds (resources regenerates).
PLEASE let this task run as on Xamarin Xamarin - as background, nonblocking task.

To reproduce issue change target framework of big Android app (should contains a lot of libraries google play services, support libraries etc), add some resource or even install nuget package (everything that starts resource resgen)

This applies to all Xamarin.VS versions.
Comment 1 Przemysław Raciborski 2017-02-18 10:55:29 UTC
typo: 
PLEASE let this task run as on Xamarin Studio* - as background, nonblocking task.
Comment 2 Juan Marcelo Tondato 2017-02-20 14:36:01 UTC
Hi,
As we've introduced several improvements around Android build system that include the fix for this bug, I'll mark the bug as resolved fixed.

If any user runs into similar symptoms with the latest versions of Xamarin, please submit a new bug report with as many details [1] as possible.  Thanks!

[1] https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/howto-file-bug/
Comment 3 Erlend Angelsen 2017-02-21 07:31:16 UTC
I have the exact same problem with the latest stable build of Xamarin Android in Visual Studio 2015. It basically renders my project unusable because it hangs for ages. Just by clicking in the references pane of my Android project I have to wait for 20-30 seconds before the system responds to my input. I don't have a repro project but as  Przemysław Raciborski explained in his post I have a lot of support libs / google play services in my project. If I open the project in Xamarin Studio it works as expected.
Comment 4 Przemysław Raciborski 2017-02-21 09:14:29 UTC
@Juan Marcelo Tondato can we expect any prerelease build to check if that works right now? Sorry but the importance of bug in my opinion is VERY HIGH.
This bug actually stops quick Android development for most people - and make people switch to other IDE (ex. XS).
Comment 5 Jose Gallardo 2017-02-21 17:11:20 UTC
Hi @Przemysław, @Erlend,

This patch is already tracked in the highest set of fixes to be released to stable, and should be public on that channel really soon.

Also, there are already some improvements on the current public bits for Xamarin VS 4.3 that can help if you want to give them a try (that's in the Beta channel).

If you're still facing this issue using those bits, please let us know.

Thanks!
Comment 6 Przemysław Raciborski 2017-02-21 22:47:07 UTC
@Jose Gallardo well.. if that fix is in beta.. then it does not work :) I am on beta channel all the time.

Simple reproduce:
1. Create Android project
2. Install a lot of packages (sample packages)

<?xml version=”1.0″ encoding=”utf-8″?>
<packages>
<package id=”Bolts” version=”1.4.0″ targetFramework=”monoandroid60″ />
<package id=”HockeySDK.Xamarin” version=”4.1.0″ targetFramework=”monoandroid60″ />
<package id=”MvvmCross.Binding” version=”4.3.0″ targetFramework=”monoandroid60″ />
<package id=”MvvmCross.Core” version=”4.3.0″ targetFramework=”monoandroid60″ />
<package id=”MvvmCross.Droid.Shared” version=”4.3.0″ targetFramework=”monoandroid60″ />
<package id=”MvvmCross.Droid.Support.V4″ version=”4.3.0″ targetFramework=”monoandroid60″ />
<package id=”MvvmCross.Platform” version=”4.3.0″ targetFramework=”monoandroid60″ />
<package id=”NineOldAndroids” version=”2.4.0″ targetFramework=”monoandroid60″ />
<package id=”Xam.Plugins.Android.SlidingUpPanel” version=”3.3.0″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.Animated.Vector.Drawable” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.CustomTabs” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.Design” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.Percent” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v13″ version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v4″ version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v7.AppCompat” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v7.CardView” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v7.MediaRouter” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v7.Palette” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v7.Preference” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.v7.RecyclerView” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Android.Support.Vector.Drawable” version=”23.4.0.1″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Azure.NotificationHubs.Android” version=”0.4.0″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Bindings.AdvancedRecyclerView” version=”0.86.0″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Bindings.CircleImageView” version=”2.1.0″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Bindings.MaterialDateTimePicker” version=”2.5.0″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Bindings.MaterialProgressBar” version=”1.1.7″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Bindings.Roughike.BottomBar” version=”2.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Bindings.UniversalImageLoader” version=”1.0.4″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.Facebook.Android” version=”4.13.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Ads” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.AppInvite” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Base” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Basement” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Gcm” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Identity” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Location” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Maps” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Measurement” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
<package id=”Xamarin.GooglePlayServices.Wearable” version=”29.0.0.2″ targetFramework=”monoandroid60″ />
</packages>

3. Go with nuget console - Update-Packages -Reinstall -IncludePrerelease

4. Visual Studio is unresponsive - while packages are adding the aapt process is run (because it has to regenerate resources).
There are actually two bugs:
a) less important - resource regeneration should be raised after all packages are installed
b) HIGH IMPORTANCE - rebuilding resources blocks visual studio as aapt is running on UI Thread. (same behavior on PC with SSD, i5-I6600K and new MacBook Pro)
Comment 7 Przemysław Raciborski 2017-02-21 22:53:31 UTC
Ideally I think resource regeneration should be optional - this just makes a lot of people driving crazy... I mean in Xamarin options there should be option:

Resource regeneration strategy
1. On any resource change (Default - triggered like in current Xamarin)
2. Manual ( resources regenerates pre-build + we should have button / option "Synchronize resources )

Giving option to people would give Xamarin some time to optimize triggers that raises resgen.
Comment 8 Przemysław Raciborski 2017-02-23 11:38:27 UTC
UPDATE:
Confirmed that new beta/stable (released today) fixed bug.
GOOD JOB!
Comment 9 Mohit Kheterpal 2017-02-24 13:07:33 UTC
Thanks @Przemyslaw

As per comment 8, closing this issue by marking it as Verified fixed.

thanks