Build Error - ResolveLibraryProjectImport task failed unexpectedly - access denied

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, IEnumerable1 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!

«1

Posts

  • GregLeeGregLee USMember

    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?

    "Target Name="_ResolveLibraryProjectImports"
    Inputs="$(MSBuildProjectFullPath);@(ReferencePath);@(ReferenceDependencyPaths);$(_AndroidBuildPropertiesCache)"
    Outputs="$(_AndroidLibraryProjectImportsCache)">


    /Target"

  • a.strakha.strakh USMember

    Same issue here, were you able to fix?

    Error   2   The "ResolveLibraryProjectImports" task failed unexpectedly.
    System.ComponentModel.Win32Exception (0x80004005): Access is denied
       at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at Xamarin.Android.Tasks.MandroidDaemon.CreateDaemon()
       at Xamarin.Android.Tasks.MandroidDaemon.GetStandardInput_Locked()
       at Xamarin.Android.Tasks.MandroidDaemon.SendCommand(Task task, String[] commands, Action`1 response)
       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)
       at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() App1
    

    Some statements:

    • visual studio 2013
    • android projects only are affected
    • xamarin studio on mac could build the same project without any errors
    • xamarin reinstallation didn't help
  • ChrisBurchettChrisBurchett USMember

    Any update on this?

  • ChrisBurchettChrisBurchett USMember

    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!

  • darrellbrowndarrellbrown USMember
    edited July 2016

    Can someone provide more details on how to resolve this?

  • PaulJohnson.0531PaulJohnson.0531 GBMember ✭✭

    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.

  • Josu_brJosu_br USMember ✭✭

    Same problem here. I was using pre realease too and need change it back to stable version.

  • GovindaGrossGovindaGross LIUniversity

    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:

    • Win7 Pro
    • VS2015 Pro with Update 3
    • Xamarin 4.1.1.3
    • Gtk# for .NET 2.12.38
    • Xamarin Studio 6.0.2
    • JDK 1.7.0.550
    • Android SDK 1.16

    Appreciate any more hints of how to fix this.

  • GovindaGrossGovindaGross LIUniversity

    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 :-/

  • softlionsoftlion FRBeta ✭✭✭

    +1, the bug affect the current beta channel.
    Does anyone from Xamarin really read customer reports ?

  • RamboOngRamboOng USMember

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

  • nvbnvbnvbnvb DEMember ✭✭

    had the same error after updating xamarin to v7. just fixed with clean all - build all - deploy

  • GaryKaganGaryKagan USMember

    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.

  • xCyborgxCyborg USMember ✭✭

    same here, Xamarin Studio 6.1 on windows, creating Forms app causes this error.

  • JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod
  • +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.

  • softlionsoftlion FRBeta ✭✭✭

    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.

  • FordFord CAMember

    I am experiencing the same issue.

  • JamesScottJamesScott USMember ✭✭

    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.

  • romyOHromyOH USMember

    I am experiencing the same issue. --;

  • melihorhanmelihorhan USMember

    Hello everyone,

    I tried to update Xamarin latest stable(4.2.0.703). It works.

  • DanHermesDanHermes USInsider, University ✭✭

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

  • LuisDuenasLuisDuenas USMember ✭✭

    any update on this? i have the same issue , updating or downgrade didn't work

  • NinjaFocksNinjaFocks USMember ✭✭

    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!

  • BuhhSathBuhhSath USMember ✭✭

    Valuable tip @NinjaFocks ! Thanks.

  • XithXith USMember
    edited January 2017

    Worked for me to turn off Avast and rebuild the solution.

  • AndreiLImaAndreiLIma USMember ✭✭

    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.

  • MichaelChengMichaelCheng SGMember ✭✭
    edited January 2017

    @dinobuljubasic said:
    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.

    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.

  • StephenGrahamStephenGraham GBMember ✭✭

    @Halukmy said:
    close multiple studios

    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

  • NurhakKayaNurhakKaya USMember ✭✭

    For my case it was long TFS path, after shortening it all is fine.

  • JoaoPaqueteJoaoPaquete USMember

    My problem with this message was related to resulting path depth over 260. Moved the project to c:\ and compiled OK !

  • PetruLutencoPetruLutenco USMember

    remove bin/obj directories , worked for me

  • amitshrivastoamitshrivasto USMember

    ResolveLibraryProjectImport task failed unexpectedly

  • amitshrivastoamitshrivasto USMember

    plz help

  • Prajakta.ShindePrajakta.Shinde INUniversity ✭✭
    edited March 2017

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

  • IvanCasanovaIvanCasanova USMember

    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.

«1
Sign In or Register to comment.