You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

NU1107错误:Xamarin.AndroidX.Lifecycle.LiveData版本冲突,需升级/降级哪个包?

解决Xamarin.AndroidX.Lifecycle.LiveData版本冲突方案

根据错误信息,冲突根源是两个依赖对Xamarin.AndroidX.Lifecycle.LiveData的版本要求不一致:

  • Xamarin.Forms 5.0.0.2515要求版本范围为 >=2.3.1.1 且 <2.4.0
  • Xamarin.GooglePlayServices.Ads 121.2.0要求版本 >=2.4.1.1

可以通过以下三种方式解决:

方案一:直接指定LiveData高版本(快速解决首选)

在MyProject.Android项目中直接安装Xamarin.AndroidX.Lifecycle.LiveData 2.4.1.1,强制覆盖依赖限制。AndroidX包普遍具备良好的向下兼容性,即便Xamarin.Forms标注了版本上限,实际运行中高版本通常能正常适配。

方案二:降级GooglePlayServices.Ads版本

查找并安装Xamarin.GooglePlayServices.Ads的旧版本,要求其依赖的Xamarin.AndroidX.Lifecycle.LiveData版本落在<2.4.0范围内。例如可尝试120.6.0版本,该版本依赖的LiveData版本符合Xamarin.Forms的要求。

方案三:升级Xamarin.Forms版本

将Xamarin.Forms升级到更高版本,选择已更新Xamarin.AndroidX.Lifecycle.LiveData依赖范围的版本(如5.0.0.2612及之后的版本),这样就能兼容Xamarin.GooglePlayServices.Ads 121.2.0所需的LiveData版本。

内容的提问来源于stack exchange,提问作者Costas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 20:25:21