错误:找不到2个AndroidX程序集,请确保安装以下NuGet包:-Xamarin.AndroidX.MediaRouter

使用 Jetbrains Rider,我创建了一个新的 Xamarin 应用程序。因为 Rider 使用旧版本 (4.4.0.991640) 创建了 Xamarin 应用程序,所以我将 Xamarin 升级到最新版本 (4.8.0.1687)。

但是,当我构建时,出现以下错误:

Xamarin.AndroidX.Migration.targets(131, 9): Could not find 2 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.MediaRouter
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.1" />

我按照说明将代码片段添加到我的.csproj文件中。

ExampleProject.Android.csproj

Xamarin.AndroidX.Migration.targets(131, 9): Could not find 2 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.MediaRouter
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.1" />

然后我:

  1. 跑到dotnet restore解决方案上
  2. 清洗了溶液
  3. 构建解决方案

但是,我仍然收到错误消息。

回答

我通过以下方式解决了这个问题:

  1. .csproj文件中删除依赖项
  2. Xamarin.AndroidX.MediaRouter从 Rider NuGet 选项卡安装最新版本的(1.2.0)

注意:我还必须安装Xamarin.AndroidX.Palette(1.0.0.5) 包来解决这两个构建错误。


以上是错误:找不到2个AndroidX程序集,请确保安装以下NuGet包:-Xamarin.AndroidX.MediaRouter的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>