xamarin android development debugging error - xamarin

I see this error while building xamarin.android:
Severity Code Description Project File Line Suppression State Error Exception while loading assemblies:
System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.v7.RecyclerView, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Xamarin.Android.Support.v7.RecyclerView.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.Execute() App3.Droid?

It appears as if the version of Android.Support is either missing or unusable. This can normally be resolved by clearing out the packages and downloading them again.
To do this, please follow the steps below:
Remove all packages from Android App (including Forms)
Add Xamarin.Forms from NuGet
The act of adding Xamarin.Forms from NuGet will retrieve the correct versions of the various Android support libraries, including those that are throwing the error and/or missing.
Please let me know if this resolves the issue.
 
Thanks!

Related

System.IO.FileNotFoundException: Could not load assembly "AppName" after update xamarin forms

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
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
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.

Xamarin Prism.Unity.Forms 7.0.0.396 give error on update from version 6.3

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Microsoft.Practices.Unity.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters)
Can you please suggest for solutions
Your error message tells you everything you need to know: Microsoft.Practices.Unity, Version=4.0.0.0. You have a reference to v4.0 of Unity. Prism 7 references v5.0. You need to check your dependencies as somewhere you have a reference to the old package.
Also note that due to some changes that were made in the way that Unity ships, Prism has also made a change from referencing the Unity package to the Unity.Container package as of Prism 7.1.

Could not load assembly 'SMDiagnostics, Version=4.0.0.0,

I have just tried updating Xamarin (for Visual Studio); it's now 4.5.0.433
My project (which compiled OK before the upgrade) now won't compile. Not
sure what my previous version was: probably 4.2.63 or earlier.
I am getting this exception:
Exception while loading assemblies: System.IO.FileNotFoundException:
Could not load assembly 'SMDiagnostics, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'. Perhaps it doesn't
exist in the Mono for Android profile?
////File name: 'SMDiagnostics.dll'//
// at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve AssemblyNameReference reference, ReaderParameters parameters)//
// at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference)//
// at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)//
// at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) LocationService/
I have investigated here Xamarin.forms Exception while loading assemblies Xamarin.Android.Support.v4).
No success.
So, I have now uninstalled all of Xamarin from VS2015 and tried
re-installing, only to find that VS2017 is now installed, and I cannot
re-install Xamarin into VS2015 - every time I try, a new install of
VS2017 is started. This is annoying in itself, I was happy with VS2015.
But even in VS2107, I am getting exactly the same error.
I have searched the Windows directory for SMDiagnostics.dll and there are several different copies in subfolders of C:\Windows\WinSxS. So why the sudden error, when the project was OK before today (nothing changed in the project itself!)

DLL issue in Xamarin.Forms Android in Visual Studio

Error
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Windows.Design.Extensibility, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Microsoft.Windows.Design.Extensibility.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) MyApps.Radiocity.Droid C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1413
I am facing the above issue in Android(Xamarin.forms). Since four days i am trying to find out the solution for this.
Please any one can tell the solution for the above issue?
Microsoft.Windows.Design.Extensibility is not a DLL that is compatible with Android. You shouldn't need it in there. Go to your References and remove this DLL.
If you have this DLL in any of your Class Libraries attached to this project, remove it from there as well.

Warnings: Cross-plaftorm Xamarin Blank App (Xamarin.Form portable)

Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. HelloWorld.Droid 1 Active
Severity Code Description Project File Line Suppression State
Warning The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'HelloWorld, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'HelloWorld.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(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() HelloWorld.Droid
I have got the same problem as this one. But there wasn't a solution to it.
I have tried updating xamarin, reinstalling visual studio with xamarin, installed almost every android sdk and tools but the error stays. I have even made a new solution but the same error appears.
Update:
With advice from the awnser of the question dev_man metioned I deleted all api's except the api 23 and above. After that is tried to update the nuget packages he mentioned but from version 23.0 to 25.1.0 . This failed and I got this error:
Severity Code Description Project File Line Suppression State
ErrorCould not install package 'Xamarin.Android.Support.Design 25.1.0'.
You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework.
For more information, contact the package author.
Well there are a number of problems that can lead to the surfacing of this issue and sadly the core issue doesnt seem visible at the initial stage.
This previous question covers a wide range of the possible causes if one reads thoroughly the solution may be found. your error might change as you follow the various steps.
click here

Resources