Visual Studio (xamarin) hanging on every build, cleanup, or rebuild when AAPT.exe runs in the background while it does

I hit my head several times on the wall, trying to figure it out.

Here's what happens:

  • Anytime I open a project, VS freezes every time for a click that I made a minute or so earlier. While you are watching the task manager, you see that AAPT.exe appears every few seconds and works for a moment, after about 3-5 minutes it completes everything that it does, and vs starts working again until I do one of other things that sets this off.
  • Same thing when I clean a project.
  • The same thing when I build / rebuild a project.
  • When debugging to a physical device, it will create and deploy to the device, and then hang with the same problem for several minutes before debugging starts

What I discovered:

This problem may be related to this error message https://bugzilla.xamarin.com/show_bug.cgi?id=43081 , however, in accordance with the instructions given in this document, do not help and cause more errors.

It seems that aapt is a crunch of my png, and it freezes, however I only have a few small icons in terms of images in the entire project, nothing that may take 2-3 minutes to compress.

What I tried:

  • Update all sdks and Android resources to the latest version.
  • Update java (64 bit) and delete all other instances except the newest one.
  • Removed and reinstalled all Android resources.
  • Edited Visual Studio (community 2015)
  • Nuked VS from https://github.com/Microsoft/VisualStudioUninstaller/releases
  • Trying to install the VS 2017 community, however, it never worked with error CLR20r3 from mscorlib 4.6.1, while the error "remoteHostService.servicehub.service.json" was not found (I checked that it exists where it should be, and it refers to VsixServiceDiscovery: the procedure imported by "Microsoft.VisualStudio.Settings.15.0.dll" cannot be loaded (I, unfortunately, do not have a complete trace, I got rid of 17)
  • After everything I reinstalled vs 15, which I worked with (barely), but it still has the same thing as when I started it.

At this point, my next step is to completely destroy my computer, which I really do not want to do, so I desperately hope that someone knows how to fix it.

+5
source share
1 answer

So, after several games, I noticed that the decent part of the packages from NuGet in my solution had a triangle, because I did not have a link.

Ultimately, I realized that after each of the events that I described above, AAPT actually reloaded each of the 20 packages that I have in my solution, because for some reason it could not link the project to local copies, even though he is there.

A solution was found in this thread: https://forums.xamarin.com/discussion/89926/the-referenced-component-xamarin-android-support-xxx-could-not-be-found-after-upgrade-with-nuget

Ronald peters

February 23

I set yellow labels, forcing to reinstall packages: open the NuGet package manager console and run "Update-Package -reinstall".

This forced all packages to remove all links from the project and reinstall them. Ultimately, most of them just found a local copy and just needed to be linked again.

Once launched, VS no longer freezes after any of the events listed above, and everything seems to be working again.

+4
source

Source: https://habr.com/ru/post/1265397/


All Articles