1
votes

So that error started appearing for no apparent reason.

I looked at these two similar threads with no avail:

The “XamlCTask” task failed unexpectedly in Xamarin

The “XamlCTask” task failed unexpectedly on visual studio for xamarin

My issue seems to be related specifically to the "Tapped" event. I remove all tapped references and the app compiles.

Here are the errors in order:

Severity Code Description Project File Line Suppression State Error Position 29:44. No property, bindable property, or event found for 'Tapped' MeetnGreet C:\Users\chris\documents\visual studio 2015\Projects\MeetnGreet\MeetnGreet\MeetnGreet\MeetnGreet.MainPage.xaml 29

Then I do a clean, build and attempt to run....

Severity Code Description Project File Line Suppression State Error The "XamlCTask" task failed unexpectedly. System.ArgumentException: An item with the same key has already been added. Server stack trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at Mono.Cecil.Pdb.PdbReader.PopulateFunctions() at Mono.Cecil.Pdb.PdbReader.ProcessDebugHeader(ImageDebugDirectory directory, Byte[] header) at Mono.Cecil.ModuleDefinition.ProcessDebugHeader() at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader) at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters) at Mono.Cecil.ModuleReader.CreateModuleFrom(Image image, ReaderParameters parameters) at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters) at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) at Xamarin.Forms.Build.Tasks.XamlCTask.Compile(IList1 thrownExceptions) at Xamarin.Forms.Build.Tasks.XamlCTask.Execute() at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.Build.Framework.ITask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() MeetnGreet

Along with error....

Severity Code Description Project File Line Suppression State Error Position 29:44. No property, bindable property, or event found for 'Tapped' MeetnGreet C:\Users\chris\documents\visual studio 2015\Projects\MeetnGreet\MeetnGreet\MeetnGreet\MeetnGreet.MainPage.xaml 29 Severity Code Description Project File Line Suppression State Error The "ResolveLibraryProjectImports" task failed unexpectedly. System.IO.FileNotFoundException: Could not load assembly 'MeetnGreet, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? File name: 'MeetnGreet.dll' at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() MeetnGreet.Android

I think all this translates to is that my forms package is corrupt. However, I am not exactly sure how to go through a clean repair or reinstall using nuget. I have never had to do it before.

Here is what the packages folder for the project looks like for ref. (because of the discussion on the other thread)

Also, disabling the compiler didn't fix the issue (ref the other threads possible solutions)

Any help would be appreciated.

enter image description here

1
git clean -xfd. what worries me is what you say about disabling the XamlC compiler and still getting the error... - Stephane Delcroix
sorry about that. I should have been more specific. I will have to repeat the process to confirm but I am pretty sure what I meant was with the compiler disabled you just got a white screen on the emulator when the app loaded. So it was still crashing but without any notification. - Chris

1 Answers

1
votes

Let me preface this by saying I have only been working with Xamarin for 2 weeks and am still working through some tutorials. That being said, this error is all my fault.

What happened was, I had been using a table view in my working examples and decided to see how grids worked. So I "converted" the tableview cells to entrycells to entry, textcells to labels surrounded by stacked views, etc...

I made an assumption that the Tapped event was everywhere so I never stopped to check if it was available in a stackview for example. I was just moving things around and the intellisense wasn't throwing up any warnings so I assumed everything was ok.

Hence the compiler crash and now the second error of no property makes complete sense now by itself and was not a result of the compiler crashing which is what I had originally thought.

Sorry for sending up a false flag. Seemed like a much larger issue that it was.