Build Error - ResolveLibraryProjectImport task failed unexpectedly - access denied

2»

Posts

  • MarioFrancisMarioFrancis USMember

    I'm having same issue here... any help will be appreciated

  • Help needed,
    Error The "ResolveLibraryProjectImports" task failed unexpectedly.

  • KW28KW28 ILMember

    Same here.

    The "ResolveLibraryProjectImports" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load assembly 'My.Xam, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    File name: 'My.Xam.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(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
    at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

  • Prajakta.ShindePrajakta.Shinde INUniversity ✭✭✭

    When I get this I had cleaned the project . Deleted the bin,obj files and rebuild the solution. Also changed the long path of the project.
    Worked for me.

  • I had the same problem earlier with sample project. I updated the xamarin.forms for every project to the stable version instead of uninstalling the older one and installing back. Clean the solution and rebuild, the problem resolved without any error.

  • loletmalupetloletmalupet USMember ✭✭

    Go to the project file and delete everything inside bin and obj folder. Works for me.

  • HimeshNagarHimeshNagar INMember

    Run visual studio as administrator worked for me...
    Press windows button from keyboard and type visual studio .. Then right click on visual studio and select "Run as administrator"..

  • SeanHaynesSeanHaynes USUniversity

    I was able to see the missing components after uninstalling Xamarin.Forms and re-installing.

  • ColmColm USMember ✭✭

    Still having this error pop up on my projects. Have tried all the usual solutions that have been posted on here with no success.

  • SandeshAcharyaSandeshAcharya USMember ✭✭

    I had the same error, by mistake i typed SS in Margin="0,10,10SS,0" property. After removing SS, project executed successfully. You may have some mistakes in your projects like i did.

  • MakkeriMakkeri USMember

    I had same problem!
    What worked for me I just checkout my project to different and shorter folder path(C:/VSProjects/) as @Prajakta.Shinde mentioned in her post.

    @Prajakta.Shinde said:

    When I get this I had cleaned the project . Deleted the bin,obj files and rebuild the solution. Also changed the long path of the project.

    I have current setup:
    Visual studio 2015
    Xamarin v4.5.0.476

  • AndrevesDickowAndrevesDickow USMember
    • Close the project.
    • Delete the folders bin and obj from solution.
    • Reopen the project.
    • Clean and Rebuild the project.

    I hope I have helped.

  • WinSomeLoseSomeWinSomeLoseSome USMember ✭✭

    I know this doesn't apply to everyone who has posted, but it is what brought me to the thread in the first place.

        <ListView.GroupHeaderTemplate>
            <DataTemplate>
                <TextCell Text="{Binding Name}"
                    Detail="{Binding Keyword}"
                    TextColor="#f35e20"
                    DetailColor="#503026" />
                <Button Text="Edit"/>
            </DataTemplate>
        </ListView.GroupHeaderTemplate>
    </ListView>
    
  • DaveCarsonDaveCarson GBUniversity ✭✭✭
    edited June 2017

    I was creating a brand new Xamarin.Forms app using Visual Studio 2017 and hit this error.

    I had updated all my nuget packages and was rebuilding when it happened - this is a skeleton application at this point so I had no idea what was happening. Was is an incompatible Nuget package or did one of them not install correctly?

    No, not a Nuget problem at all as it happens.

    The problem was that I had let Visual Studio save it to its default location and somewhere along the lines there is a files whose complete path is too long!

    Yep - I kid you not. In this day and age 'Path Too Long' is still a problem on Windows!

    Moved to root of my D drive and all is well now!

  • MukteswarMukteswar USMember ✭✭

    Got this same issue but not at all able to del the bin/obj, specifically ...Droid\obj\Release__library_projects__\MPAndroidChart**library_project_imports**

  • GaborDolhaiGaborDolhai GBMember

    In my case i accidentally referenced a Windows only library in the pcl. The error message showed it but took me some time to notice. After removing it the project was building again.

    Error The "ResolveLibraryProjectImports" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load assembly 'Windows.Foundation.UniversalApiContract.winmd, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    File name: 'Windows.Foundation.UniversalApiContract.winmd.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(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
    at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()

  • GaryParkinGaryParkin USMember ✭✭

    I had the same problem. Check your path where you started your application. Mine was in C:\Users\Gary\Documents\Visual Studio 2017\ and the path was too long. Stinking Windows.
    I put it into C:\Source and the problem went away.

  • I tried many solutions with deleting bin & obj folder, clean, rebuild, changing build configurations etc.but the only reliable workaround for me is to close and reopen Visual Studio for WIndow,but Still the Problem no Solve..

  • BrianConradBrianConrad USMember ✭✭✭

    Yup, here we are in the 21st century still stuck with a DOS criteria from the 1980s. Hit this again today after installing a Nuget package and browsing through the package it didn't seem add anything that should have thrown the error so possibly a VS bug.

  • I encountered this error today and it appears to be related to the path for the project being too long. Moving it to a more shallow path should solve this exception.

  • ChaseFlorellChaseFlorell CAInsider, University mod

    Another way this will manifest itself is if you put a collection of views inside a container that does not accept children.

    <!-- this will break -->
    <ContentView>
        <ContentView.Content>
            <!-- this needs to be wrapped in a view that accepts children like <Grid />, <StackLayout />, etc -->
            <Label Text="Foo" />
            <Button Text="Foo" />
        </ContentView.Content>
    <ContentView>
    
  • JNunesJNunes USMember

    I had the same problem and after inspecting the error message it was saying that the path to some source files were too long. After changing some directory names to short the overall path, everything worked

  • JanFrostJanFrost DEMember ✭✭

    @Halukmy said:
    close multiple studios

    Thanks that solved my problem

  • LynkLynk USMember ✭✭

    Had same problem. Here is my solution

    1. Restart Visual Studion
    2. Open the Project
    3. Clean the solution
    4. Rebuild the solution
    5. Close solution
    6. Reopen the project
  • knottydevknottydev USMember ✭✭

    Par for the course with frameworks like this in VS. Build and build often is the lesson here! This is almost a trickle-down problem and can be very difficult to find the REAL reason. Here was mine...

    See the real issue above was: "Specified argument was out of the range of valid values." Very difficult to see / figure out where that error is coming from as well. It was bad binding attempt to "Desc" property. Normally an invalid binding just silently fails and I still have no idea why this one caused a bad build. Had to rollback to figure it out.

    If I tried cleaning / rebuilding, the subsiquent ResolveLibraryProjectImport task failed error would occur and obfuscate the real issue.

  • I had the same issue, i moved the code to an upper directory which resolved the issue for me

  • AmmarHassan48AmmarHassan48 PKMember ✭✭

    I have the same issue here , using Visual Studio 2017 for xamarin forms. Does anyone found solution ?

  • HowdyHoHowdyHo USMember ✭✭

    Downloaded the appropriate Nuget packages. Cleaned the project. Unloaded the project. Reloaded the project. Restarted Visual studio. Again Unloaded the project. Reloaded the project. Then it worked.

    Not sure whether this will work for everyone. But always try to do these things before jumping on to more complicated solutions. This is pretty much XAMARIN 101.

  • RAUFFRAUFF USMember

    Just Change the location of your project to shortest path, that's it error will disappear

  • I am getting following error.

    Severity Code Description Project File Line Suppression State
    Error The "ResolveLibraryProjectImports" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load assembly 'KtMobileApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    File name: 'KtMobileApp.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, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
    at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() KtMobileApp.Android

  • PhenmanPhenman USMember ✭✭✭

    I do not understand why all the time there are some strange problems.
    Constantly, some connections are lost or some problems with import!
    It is impossible to work because of unstable work of xamarin :s :s :s :s :s :s :s :s :s :s :s

    The "ResolveLibraryProjectImports" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load assembly 'AQT_Mobile, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    File name: 'AQT_Mobile.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, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
    at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

  • FinsterDexterFinsterDexter Member

    I'm getting this error as well (ResolveLibraryProjectImports) and I think this error is just hiding other errors. I went through my build log (set to Detailed in VS options) and I found some other errors occurring and when I resolved THOSE errors, this error went away. So, I think this error might be the result of some buggy tooling not exposing the underlying errors. I'm just guessing, though.

  • George.4397George.4397 USMember

    I was able to figure this out:
    See link "bugzilla.xamarin.com/show_bug.cgi?id=41968#c2"

    Basically, I wanted to use "ApplicationData.Current.LocalFolder.Path" from my .NET Standard library project(to use from my UWP project, using "Device.RuntimePlatform" enum) so it added a reference to "Windows.Foundation.UniversalApiContract.winmd.dll". I changed the folder to "Environment.SpecialFolder.LocalApplicationData" for my UWP project and I removed the ref to "Windows.Foundation.UniversalApiContract.winmd.dll". Voilà!. Problem Solved!

    I HTH
    G.P.

  • DonaldOdiachiDonaldOdiachi USMember ✭✭

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

    This worked for me!

  • eubikeubik Member ✭✭

    I manually deleted bin/obj folders, cleaned, rebuilt, restarted etc. but it didn't help. File path lengths were not an issue either.
    I ended up re-installing Xamarin.Forms and that seems to have fixed this problem...for some reason.

  • NicolaLoroNicolaLoro USMember ✭✭

    In my case, there was no way to fix it by cleaning, rebuilding, deleting bin and obj folders or restarting VS. The error message was very weird. Together with the error of this topic I had a "Value cannot be null. Parameter name: method".
    Which was pointing to line 1 of a XAML file. Totally no sense.
    Then I started to remove part of the XAML code in that file, and I found it was building. With this "monkey approach", I've been removing XAML code, building and see if it worked or not. Finally I found there was an error on a Label item. The FontSize attribute was not correct. Fixed it, and it finally worked.
    But this is frustrating. Lost hours to find it. The build process from the nineties, purely from command line, was more precise in giving you the error position.

Sign In or Register to comment.