The “XamlCTask” task failed unexpectedly on visual studio for xamarin

后端 未结 8 906
南方客
南方客 2020-12-29 02:21

When I am trying to run application on Xamarin on visual studio, I am getting error as mentioned below and not able to run the application on device or emulator:

<         


        
相关标签:
8条回答
  • 2020-12-29 02:49

    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)
  • 2020-12-29 02:56

    When We Add ContentPage Page in Xamarin.Forms. and in that page we add more then one ContentPage.Content in same page. Then also we get this type of the error.

    0 讨论(0)
  • 2020-12-29 02:59

    This issue arise, if your Xamarin.Form version is not compatible/matching with your NuGet package which you have installed.

    So, I have just updated Xamarin.Forms for both xx.Droid and PCL and make the match the dependencies with NuGet package.

    Now it is working fine. Hope so this will work for you.

    0 讨论(0)
  • 2020-12-29 03:03

    Delete your old package /[your project root]/packages/Xamarin.Forms.[old version number].

    0 讨论(0)
  • 2020-12-29 03:06

    Updating Xamarin.Forms to the latest version on both android and iOS project and reopened the project worked for me.

    0 讨论(0)
  • 2020-12-29 03:09

    I removed all Xamarin references from ALL projects, removed ALL Xamaring packages. Deleted all mention of Xamarin in PROJ files and readded all nuget packages for Xamarin. (lost days on this) :)

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