The “ResolveLibraryProjectImports” task failed unexpectedly

后端 未结 24 1966
醉话见心
醉话见心 2021-01-01 09:48

I have a Xamarin project, which is based on MvvmCross. The project is for both iOS and Android. I opened this project in Visual Studio 15. I got some errors, wh

相关标签:
24条回答
  • 2021-01-01 10:12

    I have faced the same problem today. After two days searching, I have found the solution here. The issue is Xamarin.Forms library does not install all its dependent Nuget packages while first creating project by choosing cross-platform Mobile(Xamarin.Forms) project template from Visual Studio 2017. I have to manually install the upgraded dependent nuget packages to build the project successfully. Also have removed and added Xamarin.Forms at the end which resolves the issue.

    Also, it is some time creating issues when two instances of Visual Studio 2017 is running, make sure only one instance is only running as I have encountered this issue as well.

    0 讨论(0)
  • 2021-01-01 10:14

    This kind of issue may also come if by mistake you have any syntactical error like in my case: two text cells were present in the ListView -

    <ListView x:Name="ProductsView">
        <ListView.ItemTemplate>
            <DataTemplate>
                <TextCell Text="{Binding ProductId}" />
                <TextCell Text="{Binding ProductDescription}" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
    

    I went through other posts for this issue and found the same issue occurred due to the presence of syntactical errors, which VS doesn't report directly. So look for this, otherwise, reinstall the compatible version of xamarin.forms -> clean solutions -> rebuild by reopening VS.

    0 讨论(0)
  • 2021-01-01 10:17

    This worked for me:

    • Clean solution
    • Build one project at a time starting at the top - NOT rebuild solution - just one project at a time
    • Try deleting the contents of Obj and bin folder as well
    • When done delete the project from the emulator or device before you run it again

    Hope this helps.

    0 讨论(0)
  • Still have issues ? Check your namespaces and your xaml code. Sometimes when you copy/paste some files, it can be the problem.

    0 讨论(0)
  • 2021-01-01 10:18

    Here is the problem: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Try to move you project to another location like "C:/" , or change the name of the project for something more brief

    0 讨论(0)
  • 2021-01-01 10:19

    This was how I got the error. In a StackLayout I put in a Padding property, and I seperated the 4 digits by a space rather than a comma. To find the bug I had to comment out the XAML controls individually and rebuild to isolate where the error is, and eventually I found the problem line. So basically this was the error message I got for a syntax error in my XAML code! In any other language I would expect to be informed what the error is so I can fix it in seconds. But this took me a few hours - although next time I know what to do.

    0 讨论(0)
提交回复
热议问题