Bug: XamlCTask task could not be initialized

I am documenting this since this is a bug in Xamarin.Forms nuget package version You’ll get an error like,

"XamlCTask" task could not be initialized with its input parameters.
The "DebugType" parameter is not supported by the "XamlCTask" task.

The best solution is to update your nuget package for Xamarin.Forms, just make sure that all projects have the same version. The current latest version does not have this issue.

But if you can’t update nuget packages, here is how to fix this issue,

  1. Open the packages/Xamarin.Forms.\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.Targets file in notepad, and
  2. Remove the DebugType = “$(DebugType)” line ..

Clean/Rebuild, you should be good to go!