The "ResolveLibraryProjectImports" task failed unexpectedly.

I just installed VS 2017.
Got this warning after creating a cross platform project.

Severity Code Description Project File Line Suppression State
Warning The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'App1, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'App1.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() App1.Android

Posts

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Same as always.
    Create the solution.
    Clean the solution.
    Close the solution
    Re-open the solution so it goes though its Loading... process
    Rebuild the solution.

  • RK1RK1 USMember ✭✭

    thanks

  • kylehumfeldkylehumfeld USMember ✭✭

    So what happens when that doesn't work? Because I tried it, and it didn't.

  • Prajakta.ShindePrajakta.Shinde INUniversity ✭✭

    I am getting this issue for xamarin.android. I tried clean solution, rebuild solution, Deleted bin , obj files too.
    Having same error again and again. Can't proceed further due to this issue. Please help anyone. :s

  • AyaElMoatazAyaElMoataz USMember

    Same here .. We need urgent help please

  • ChrisMacLeanChrisMacLean CAMember ✭✭

    Same problem. Using Visual Studio 2017. Created a new Xamarin Forms PCL project, ran the Nuget updates and try to build and get the 'ResolveLibraryProjectImports' error. Is there an answer for this?

  • ChrisMacLeanChrisMacLean CAMember ✭✭

    SOLUTION: The problem is that if the project is in the default Visual Studio Project directory the name was too long for the Android project. I moved the solution to a different drive which resulted in a shorter name and the error disappeared.

  • cammy_sweetcammy_sweet BRMember

    @ChrisMacLean said:
    SOLUTION: The problem is that if the project is in the default Visual Studio Project directory the name was too long for the Android project. I moved the solution to a different drive which resulted in a shorter name and the error disappeared.

    WORKS!

  • it happened to me too with a fresh new "Hello World" project !!

    >

    Solution::

    Rebuild the project....

    solved!!

  • LynkLynk USMember ✭✭

    Had same problem. Here is my solution

    1. Restart Visual Studio
    2. Open the Project
    3. Clean the solution
    4. Rebuild the solution
    5. Close solution
    6. Reopen the project
  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Clean solution
    From the top project downward, build each project - NOT Rebuild the entire solution. Build each project one at a time.
    Delete any deployed copy of the app from your device.
    F5 - Debug (which will deploy)
    Works every time for me.

  • AndreCarAndreCar USMember

    For those who may still be plagued with this problem, I discovered a well-hidden cause and a solution that worked in my case. I had the good fortune of having one solution that was not impacted following an upgrade to the latest version of Xamarin and VS 2017. A second solution did not fare as well.

    After trying every solution I could find on the web, I decided to walk through the Android csproj file of the troubled solution, line by line. (To review, “unload” the Android project and “edit” the csproj.) While doing so, I ran across an alarming set of lines. It read similar to the following.

      <ItemGroup>
        <ProjectReference Include="..\MyApp\MyApp.csproj">
          <Project>{1111XXXX-11XX-1111-XX11-XX11XX11XX11}</Project>
          <Name>MyApp.iOS</Name>
        </ProjectReference>
      </ItemGroup>
    

    Why the Android project is referencing the iOS project was confusing—especially when the include parameter suggested the PCL project. The working solution confirmed my suspicions. The Android project should reference the PCL project.

    The solution: “Unload” and “edit” the PCL project. Copy the PCL ProjectGuid listed in the PCL project csproj file. Return to the Android project csproj file and replace the guid listed on line #3 in the XML lines above with the PCL ProjectGuid and delete the “.iOS” on line #4.

    While in the csproj file, I also discovered a few duplicate NuGet package references, in which they were trying to import two versions of the same package. After ensuring NuGet Package Manager lists the latest package versions, I removed lines in the Android csproj file attempting to import older NuGet package versions.

    After reloading the unloaded projects, solution builds were successful, just as they were prior to the Xamarin and VS 2017 upgrade. I was finally back in business, following a few days of hair pulling frustration.

    Hopefully this helps others.

    Cheers,

  • AndreCarAndreCar USMember

    For those who may still be plagued with this problem, I discovered a well-hidden cause and a solution that worked in my case. I had the good fortune of having one solution that was not impacted following an upgrade to the latest version of Xamarin and VS 2017. A second solution did not fare as well.

    After trying every solution I could find on the web, I decided to walk through the Android csproj file of the troubled solution, line by line. (To review, “unload” the Android project and “edit” the csproj.) While doing so, I ran across an alarming set of lines. It read similar to the following.

    1. \<ItemGroup>
    2. {1111XXXX-11XX-1111-XX11-XX11XX11XX11}
    3. MyApp.iOS

    Why the Android project is referencing the iOS project was confusing—especially when the include parameter suggested the PCL project. The working solution confirmed my suspicions. The Android project should reference the PCL project.

    The solution: “Unload” and “edit” the PCL project. Copy the PCL ProjectGuid listed in the PCL project csproj file. Return to the Android project csproj file and replace the guid listed on line #3 in the XML lines above with the PCL ProjectGuid and delete the “.iOS” on line #4.

    While in the csproj file, I also discovered a few duplicate NuGet package references, in which they were trying to import two versions of the same package. After ensuring NuGet Package Manager lists the latest package versions, I removed lines in the Android csproj file attempting to import older NuGet package versions.

    After reloading the unloaded projects, solution builds were successful, just as they were prior to the Xamarin and VS 2017 upgrade. I was finally back in business, following a few days of hair pulling frustration.

    Hopefully this helps others.

    Cheers,

  • AndreCarAndreCar USMember

    For those who may still be plagued with this problem, I discovered a well-hidden cause and a solution that worked in my case. I had the good fortune of having one solution that was not impacted following an upgrade to the latest version of Xamarin and VS 2017. A second solution did not fare as well.

    After trying every solution I could find on the web, I decided to walk through the Android csproj file of the troubled solution, line by line. (To review, “unload” the Android project and “edit” the csproj.) While doing so, I ran across an alarming set of lines. It read similar to the following.

      <ItemGroup>
        <ProjectReference Include="..\MyApp\MyApp.csproj">
          <Project>{1111XXXX-11XX-1111-XX11-XX11XX11XX11}</Project>
          <Name>MyApp.iOS</Name>
        </ProjectReference>
      </ItemGroup>
    

    Why the Android project is referencing the iOS project was confusing—especially when the include parameter suggested the PCL project. The working solution confirmed my suspicions. The Android project should reference the PCL project.

    The solution: “Unload” and “edit” the PCL project. Copy the PCL ProjectGuid listed in the PCL project csproj file. Return to the Android project csproj file and replace the guid listed on line #3 in the XML lines above with the PCL ProjectGuid and delete the “.iOS” on line #4.

    While in the csproj file, I also discovered a few duplicate NuGet package references, in which they were trying to import two versions of the same package. After ensuring NuGet Package Manager lists the latest package versions, I removed lines in the Android csproj file attempting to import older NuGet package versions.

    After reloading the unloaded projects, solution builds were successful, just as they were prior to the Xamarin and VS 2017 upgrade. I was finally back in business

    Hopefully this helps others.

    Cheers,

  • CharwakaCharwaka INMember ✭✭✭

    In my case Just Unload Reload "Resources" Folder in Xamarin.Android

Sign In or Register to comment.