我正在尝试将项目更新到最新版本的Xamarin Forms,我收到了一个错误。错误如下
无法解析依赖项。 'Xamarin.Android.Support.Design 25.4.0.2'与'Xamarin.Forms 2.4.0.282约束:Xamarin.Android.Support.Design(= 23.3.0)'不兼容。
虽然错误信息很明显,但新的Xamarin.Forms软件包需要旧版本的Xamarin.Android.Support.Design,这很奇怪。
所以,我创建了一个新项目,我看到新项目中的版本是: Xamarin.Forms 2.4.0.282和Xamarin.Android.Support.Design 25.4.0.2(!)
这很奇怪。新项目包含版本25.4.0.2 Xamarin.Android.Support.Design。旧项目拒绝更新,因为它包含该版本的Xamarin.Android.Support.Design。没有多大意义。
所以,问题是为什么,我是否收到此错误以及为什么我无法更新到新版本的Xamarin.Forms?
答案 0 :(得分:0)
首先尝试更新您的Android支持库,然后更新到最新的xamarin表单2.4.0
答案 1 :(得分:0)
You're getting the error because Xamarin does not use latest versions of those android support libraries. You can see that when you install Xamarin.Forms package (Nuget-Manager: update only Xamarin.Forms), if it depends on newer versions of android support packages it will automatically update them.
So basically as long as Xamarin.Forms does not use latest android packages, they will always show 'update available' but when you update them, they're not compatible with Xamarin.Forms anymore.
Edit:
Sometimes it seems deleting packages and bin/obj folders is not enough. If found this link with instructions for deleting nuget cache.