Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 runs aapt.exe process uses 100% usage of CPU

I am using visual studio 2015 update 2 community version to build Xamarin Applications. When I add a new nuget package or update my existing packages the aapt.exe process turns on which uses 100% of the CPU. It keeps me waiting for ages to complete the nuget package installation. Any one facing the same problem. Solutions to this are highly appreciated.

like image 638
Akash Amin Avatar asked May 19 '16 05:05

Akash Amin


2 Answers

Open your Android project file in your text editor of choice and add the following to the main PropertyGroup, Debug configuration:

<AndroidResgenExtraArgs>--no-crunch</AndroidResgenExtraArgs>

The the aapt.exe process is trying to crunch (process) all of your image (png) files whenever you add a new nuget package or component.

like image 54
Dominic Williams Avatar answered Oct 21 '22 01:10

Dominic Williams


Open your project in a text editor and add:

<AndroidExplicitCrunch>true</AndroidExplicitCrunch>

to the property group for the debug configuration(s).

This will make the build system cache the files generated by aapt so that in future it will only be run on files which have changed. The first build after adding this will still be really slow while the cache is built, but subsequent builds should be much faster. This should also be true for runs of aapt triggered by changing resource files etc. they should also use the cache and be faster.

like image 33
Simon Jackson Avatar answered Oct 20 '22 23:10

Simon Jackson