Context Developer Community 1038779:
There is a known issue in 16.7 Preview 1 where Visual Studio will crash unexpectedly when a Xamarin.Android project is in the solution. The issue on appears on projects which set the AndroidUseManagedDesignTimeResourceGenerator MSbuild property to False.
<AndroidUseManagedDesignTimeResourceGenerator>False</AndroidUseManagedDesignTimeResourceGenerator>
Workaround.
For now setting AndroidUseManagedDesignTimeResourceGenerator to True or removing the element completely fixes the issue.
Cause
As part of the effort to improve build times 16.7 Preview 1 uses the newer aapt2 daemon mode to compile resources. As part of this we need to set the InputEncoding for the process to be UTF8. This is so that paths which contain accents or special characters are interpreted correctly by aapt2. For some reason when doing a background Design Time build setting the InputEncoding is failing with the following exception.
System.IO.IOException: The handle is invalid.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.Console.set_InputEncoding(Encoding value)
at Xamarin.Android.Tasks.Aapt2Daemon.Aapt2DaemonStart()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Context Developer Community 1038779:
There is a known issue in 16.7 Preview 1 where Visual Studio will crash unexpectedly when a Xamarin.Android project is in the solution. The issue on appears on projects which set the
AndroidUseManagedDesignTimeResourceGeneratorMSbuild property toFalse.Workaround.
For now setting
AndroidUseManagedDesignTimeResourceGeneratortoTrueor removing the element completely fixes the issue.Cause
As part of the effort to improve build times 16.7 Preview 1 uses the newer
aapt2daemon mode to compile resources. As part of this we need to set theInputEncodingfor the process to beUTF8. This is so that paths which contain accents or special characters are interpreted correctly byaapt2. For some reason when doing a background Design Time build setting theInputEncodingis failing with the following exception.