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
Related
Last week I quite suddenly got this error while building Xamarin.Android for release. Last time I built the project for release everything worked fine.
The projects builds when I choose to link no assemblies, but when I use “Link SDK assemblies only” it fails. And it fails across every branch I have. I have tried to build my master-branch that has not changed since before last time i worked, and that also fails now.
I have also tried to delete bin & obj and checked Android versions and that packages match
Visual Studio is updated, and also have re-installed it, also re-installed Xamarin and Android SDK.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2145,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamrin.Android.Common.targets(2145,5): error MSB4018: System.IO.FileNotFoundException: Could not load assembly ‘ProjectName.Droid, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
Update
I've got an answer from a Xamarin.Android contributor who explained what has happened to the build process.
The "SignAndroidPackage" MSBuild target no longer depends on the "Build" target so, I think, it implicates if an Android project has "DefaultTargets" set to only "SignAndroidPackage" then this target won't be able to find the project compiled DLL since it was not built.
Thus I assume that this is why we have "LinkAssemblies" task failed.
To resolve the error I've added the "Build" target just before "SignAndroidPackage".
Old comment
I've faced the same error in my project after migrating to Visual Studio 2019.
Everything is fine in Visual Studio 2017 and Visual Studio for Mac. Thus I presumed that it might be a bug and raised an issue on GitHub.
We may both follow it here: https://github.com/xamarin/xamarin-android/issues/3715
The solution was to remove <RunCodeAnalysis>true</RunCodeAnalysis> from the android.csproj-file. The problem was that the linker tried linkage before the packages got prepared for linking.
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.
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!)
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.
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!