Hello everyone,
Long story short, I believe something is wrong with either (or both) my Visual Studio and Xamarin install.
Basically, when attempting to build or run ANY project -- even have made new Blank App (android) projects with nothing in them -- I get this error while building.
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: The "ResolveLibraryProjectImports" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: System.ComponentModel.Win32Exception (0x80004005): Access is denied
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at System.Diagnostics.Process.Start()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Xamarin.Android.Tasks.MandroidDaemon.CreateDaemon()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Xamarin.Android.Tasks.MandroidDaemon.GetStandardInput_Locked()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Xamarin.Android.Tasks.MandroidDaemon.SendCommand(Task task, String[] commands, Action1 response) 1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Xamarin.Android.Tasks.MandroidDaemon.ExtractResources(Task task, String importsDirectory, Boolean hashAssemblyDirectoryName, String outputDirectory, String outputImportDirectory, IEnumerable
1 assemblies, String[]& jars, String[]& resolvedResourceDirectories, String[]& resolvedAssetDirectories, String[]& resolvedEnvironments)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
I have tried this with both 2013 and 2015. And I have also uninstalled/reinstalled VS and Xamarin.
Any advice would be appreciated. Thanks!
Posts
When going to this specific file (called Xamarin.Android.Common.Targets) this is the section of code that appears to be set incorrectly. The pointers do not link properly. Anyone have any idea how to fix this?
Same issue here, were you able to fix?
Some statements:
Any update on this?
I found this to be caused by security software running on my system. So check your anti-virus. I have seen threads on Avast! and in my case, I was running Cylance. Once I reconfigured Cylance, I was able to reinstall Xamarin and the issue went away. Hope this helps others avoid wasting time chasing this!
Can someone provide more details on how to resolve this?
It looks like there is something not installing. I've been having this issue for a while on the alpha channel. I've just downgraded Xam.Android to stable and can now compile. If I then change it back to alpha, it returns. Time to get it into BZ me thinks.
Same problem here. I was using pre realease too and need change it back to stable version.
Same problem here.
Have only been using the latest stable version.
Several attempts to repair and a complete reinstallation of VS2015 with Xamarin and Android SDK did not change anything.
AV deactivation and/or running with Administrator privileges didn't work either.
Installed Xamarin Studio... but exact same problem there.
The system:
Appreciate any more hints of how to fix this.
After many more failed attempts today I tried to update Xamarin from latest stable to latest beta.... IT WORKS NOW!
Currently running Xamarin 4.2.0.628... and not touching it as long as it keeps working... this fragile flower cost me 2 days :-/
+1, the bug affect the current beta channel.
Does anyone from Xamarin really read customer reports ?
+1 same issue here, just upgrade xamarin studio and open up my project with xamarin studio and close it.
Use visual studio to open the project and build to see this error.
had the same error after updating xamarin to v7. just fixed with clean all - build all - deploy
same issue here, but i must have caused it by clicking everything trying to learn this stuff. All I did to fix it was reinstall XamarinInstaller.exe - which was quick, as it only does a repair of sorts it seems.
same here, Xamarin Studio 6.1 on windows, creating Forms app causes this error.
https://bugzilla.xamarin.com/show_bug.cgi?id=44460
+1 Same Issue Here
It only happens after some time, but when it occurs once, then it occurs with every attempt to compile. It can be solved by closing and re-starting Visual Studio. Yet, it is very annoying to regularily have to re-start Visual Studio in order to compile :-/
As a side note: Is it possible to completely disable or even uninstall the Xamarin Android Designer? I don't use it at all and I don't need it.
AndreasSelle: rename .axml files to .xml
Will compile and run fine.
No more custom designer / buggy xml editor, only fast native xml vs editor.
Having the same error message as described here. It happens after my designs (.axml) were opened in the Design Viewer. Rebuilding and cleaning solution don't work. Only solution is to restart VS.
I am experiencing the same issue.
Hi all, the only way I'm able to compile is if I close down all my .axml files and restart Visual Studio. I even tried opening the .axml file as xml with open with... It still opened in Android editor which is definitely the problem. I really liked the suggestions of renaming .axml to xml files (because I never use the Android UI editor anyway, just raw xml). This seems to work great.
So now I have quicker opening of my layout files and I can compile!
Be nice if Xamarin fixed this bug soon though. Hope this helps someone.
I am experiencing the same issue. --;
Hello everyone,
I tried to update Xamarin latest stable(4.2.0.703). It works.
Workaround: Check your projects to see if there are any broken references. (marked with yellow triangle) Delete all broken references. Recompile.
For us, the bug is that VS improperly reports broken refs with this misleading error '"ResolveLibraryProjectImports" task failed unexpectedly'.
any update on this? i have the same issue , updating or downgrade didn't work
close multiple studios
Restarting VS and other solutions above didn't work for me.
I had to unload both Android & iOS projects (in this case they're the only ones we're working on) and try and build. The error was coming from my Droid project so then I could see all the actual issues from my PCL (had just done a load of refactoring so lots of issues), once I had solved these I reloaded the Droid project and it built/deployed fine.
Hope this helps!
Valuable tip @NinjaFocks ! Thanks.
Worked for me to turn off Avast and rebuild the solution.
In my case, I was getting error The "ResolveLibraryProjectImports" task failed unexpectedly. when I open a project downloaded from Xamarin.University on Windows 10 and the path for one of the files ends up being to long (longer than 260 characters). So, to solve my problem, I would copy the directory as shallow as possible, so instead working directly in the structure of downloaded project, I would copy deepest directory containing the project into my C:. Building would work then without an issue as the path to all files in the project got shortened.
Ok, it's a little bit strange...In my case a cause of error seemed an corrupted .xaml file. Clean project, then exit of VS works, but after clean all and rebuild the whole application, one .xaml file seemed to continue with error. then i copied the code into another editor, deleted it and recreate it again, then i pasted the code back. seems to work with me.
I have the same problem with a project I downloaded from Github. Just like you @dinobuljubasic, I moved the deepest project up the folders and reload it into VS. It built without any more errors.
VS should have detected the problem and provided a clearer error.
Thanks Halukmy - this worked for me. I had a sample project open next to my main XF project and sample refused to build. As soon as I closed my main XF project the sample built OK.
SteveG
For my case it was long TFS path, after shortening it all is fine.
My problem with this message was related to resulting path depth over 260. Moved the project to c:\ and compiled OK !
remove bin/obj directories , worked for me
ResolveLibraryProjectImport task failed unexpectedly
plz help
I am having the same issue "The "ResolveLibraryProjectImports" task failed unexpectedly." in Xamarin. Android.
Deleting bin ,obj file did resolve the issue. Also tried restarting the VS and PC too.
Please help.
I had the same problem, I updated Xamarin.forms and android SDK and It resolved part of the problem. It seemed that there was a problem with Hyper-V and VS Android Emulator (Because both of them use the same hd resourses) , so I turned it ( Hyper-V ) off, and the problem was resolved.