Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error : Error initializing task XamlG: Not registered task XamlG

I am developing a Xamarin Forms (PCL) application for IOS and Android Platform.

My Xamarin Studio version is 5.5.4 (Build 15). I am on stable channel.

My Xamarin Forms dll version is 1.3.0.6292.

I have also added a Xamarin Forms Labs reference from NuGet, v1.2.0.

Since yesterday, whenever i am building the solution, i get following error:

error : Error initializing task XamlG: Not registered task XamlG.

Any possible resolution for this error? I have tried clean and build multiple time. Even deleted the entire source code and redownloaded everything from source control but same error.

like image 644
Kartik Avatar asked Mar 18 '23 09:03

Kartik


1 Answers

This error can occur if you have upgraded from an older version of Xamarin.Forms to a newer version. The underlying problem is that the wrong Xamarin.Forms.Build.Tasks.dll is being loaded compared with the one that the custo MSBuild Xamarin.Forms.targets file is expecting.

There is a bug in Xamarin Studio where the old build Xamarin.Forms build tasks are still used after the NuGet package has been upgraded. You can workaround this by closing and re-opening the solution.

However you say you have deleted the source code and downloaded everything again so it sounds like you have a different problem. It may be that your project is trying to use two different versions of Xamarin.Forms at the same time. I would look at your project files (.csproj) in a text editor and make sure they are all using one version of Xamarin.Forms. Check that they are all referencing a single version of Xamarin.Forms.targets and it is the same version.

like image 90
Matt Ward Avatar answered Mar 20 '23 04:03

Matt Ward