2

I can't rebuild the project and I'm getting this exception after updating to latest Xamarin Forms 3.4.0.1008975 , if I downgrade it to 3.1.0.583944 or lower the exception will gone and I can build successfully.

I've tried to update VS and clean - close - reopen but the problem still there , I also tried to move the project to C:/ but no luck .

Error       The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'SouqAlData, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'SouqAlData.dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection`1 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() SouqAlData.Android  

enter image description here

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
Khalid Hex
  • 119
  • 2
  • 14

2 Answers2

1

My understanding of the situation tells me that you do not have the latest version of Xamarin which comes along with Visual Studio 15.9.xx.

And hence when you update your Xamarin Forms package to the latest version of that is available it sees a discrepancy in between the versions and hence might be throwing this. One more reason could be that when you update your Xamarin Forms package, somehow the path for your SouqAlData.dll is lost by VS and hence you get this error. What I would suggest you do in case two is that you provide the proper path for your .dll again to VS and see if that helps you build the project.

You can give the path as follows:

  • Remove the existing reference to the .dll
  • In your project go to References>Add Reference>Browse then give it the .dll path from your solution directory.

Update:

From recent Xamarin forms update code behind doesn't support Task return type as signatures for event handlers.

So Replacing the Task with Void return type did the trick. Reference

FreakyAli
  • 13,349
  • 3
  • 23
  • 63
  • Well i can't reference it because it doesn't exist , like i said i can't build the project ... when i downgrade to a lower version i can build the project and the directory that contain .dll is there ... but when i update the packages and hit rebuild the netstandard2.0 directory that contain SouqAlData.dll doesn't exist and i think that because the project hasn't successfully been built in the first place . – Khalid Hex Nov 21 '18 at 13:46
  • Is `SouqAlData` a project in your solution or an external dll? – FreakyAli Nov 21 '18 at 13:50
  • Did you try updating visual studio to the latest version? – FreakyAli Nov 21 '18 at 14:01
  • so this issue only happens with the latest version of Xamarin forms dll am i right? – FreakyAli Nov 21 '18 at 14:06
  • Well it just worked after i saw this answer (From recent Xamarin forms update code behind dont support Task return type as signatures for event handlers.) https://stackoverflow.com/questions/52893416/xamarin-skiasharp-signature-return-type-of-eventhandler-doesnt-match-the-eve – Khalid Hex Nov 21 '18 at 14:22
  • So converting it to void did the trick ha nice, You want me to update it in my answer and you will mark it right? – FreakyAli Nov 21 '18 at 14:23
  • Yeah .. you can do that . – Khalid Hex Nov 21 '18 at 14:29
  • Done Take and revert in case i have not added something! – FreakyAli Nov 21 '18 at 14:29
-1

This error happens when you have another error in the solution in your case in xaml file check for you xaml code for a mismatch code or events. In my case i found "-->" in the xaml file and it was the problem.

Wonde_Man
  • 55
  • 6