Using Jetbrains Rider, I created a new Xamarin application. Because Rider creates a Xamarin application with an older version (4.4.0.991640), I upgraded Xamarin to the latest version (4.8.0.1687).
However, when I build, I get the following error:
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" />
I followed the instructions by adding the snippet to my .csproj
file.
ExampleProject.Android.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<!-- Newly added -->
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.1" />
</ItemGroup>
</Project>
Then I:
- Ran
dotnet restore
on the solution - Cleaned the solution
- Built the solution
However, I'm still getting the error.