Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

The "XamlG" task failed unexpectedly

$
0
0

Hi all,

I am encountering an error very randomly when I try to build my project. Sometimes I can rebuild my project without problems for a day or so, but somehow this error keeps coming back after some time. Sometimes I can easily fix this by cleaning the projects/solution and/or deleting all the bin/obj folders and all downloaded NuGet Packages, but other times (like now) I just can't seem to fix this error..

This is the error message I get:

Error  1   The "XamlG" task failed unexpectedly.
System.Exception: Can't load types from xmlns clr-namespace:NewsApp.UI.Controls;assembly=NewsApp
   at Xamarin.Forms.Build.Tasks.XamlG.GetNamespace(String namespaceuri)
   at Xamarin.Forms.Build.Tasks.XamlG.GetType(String nsuri, String type, IList 1 typeArguments, Func 2 getNamespaceOfPrefix)
   at Xamarin.Forms.Build.Tasks.XamlG.GetNamesAndTypes(XmlNode root, XmlNamespaceManager nsmgr)
   at Xamarin.Forms.Build.Tasks.XamlG.GenerateFile(String xamlFile, String outFile)
   at Xamarin.Forms.Build.Tasks.XamlG.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() NewsApp.Android

When reading this error message it looks like there is a problem with my UI.Controls namespace, but I did not change anything here recently. This error is showing up since I added a new PCL with resource files for supporting multilanguages.

So my project setup is now like this:

NewsApp (Solution)
    Shared (Folder)
        NewsApp.Localization (PCL)
        NewsApp (Shared Project for Xamarin.Forms)
    NewsApp.Android
    NewsApp.IOS
    NewsApp.WinPhone

I am using Visual Studio 2013 and Xamarin.Forms 1.2.3.6257.

Any ideas on how to fix this problem, or at least REALLY clean the project? Because like I said, sometimes it just builds for a whole day without problems.

UPDATE:

So after I posted this, I simply tried to directly run the project again and it worked. I did not even clean or rebuild the project. It looks like when I wait long enough the issue solves it self.. is there maybe some kind of cache I can clear to force somehow force this?


Viewing all articles
Browse latest Browse all 58056

Trending Articles