Xamarin cross-platform (portable class) project compilation error

前端 未结 2 1340
忘了有多久
忘了有多久 2021-02-11 07:37

I made a new blank cross-platform project using a portable class library in visual studio, BUT when I try to build a platform project I have a list of errors:

Er         


        
2条回答
  •  情话喂你
    2021-02-11 08:10

    You need to use the specific/minimium versions of the packages that are mentioned in the error message. The safest way to do it is to remove all nuget packages (including Xamarin.Forms) and then add Xamarin.Forms nuget package, which will add all its dependencies with the specific versions.

    Explanation, by James Montemagno:

    Xamarin.Forms locks in a very specific version of the support libraries and google play services. You can't update them because Xamarin.Forms isn't compatible with them as it would need to be re-compiled.

    Xamarin.Android.Support.v4 (= 23.0.1.3)

    Xamarin.Android.Support.Design (= 23.0.1.3)

    Xamarin.Android.Support.v7.AppCompat (= 23.0.1.3)

    Xamarin.Android.Support.v7.CardView (= 23.0.1.3)

    Xamarin.Android.Support.v7.MediaRouter (= 23.0.1.3)

    See the = 23.0.1.3, which means it is only compatible with that version number. This is just how NuGet works. When Xamarin.Forms updates these packages will auto update.

提交回复
热议问题