Home > Software design >  Version conflict detected for Xamarin.Google.Android.Material
Version conflict detected for Xamarin.Google.Android.Material

Time:01-04

I use the MonoGame 3.8.1.303 template to create my Android project, not the MAUI template. And I set UseMauiEssentials to true in my Android csproj file so that I can use Microsoft.Maui.Essentials.

The problem is that I cannot install the NuGet package Xamarin.Forms 5.0.0.2545 in my Android project because I get this error:

Version conflict detected for Xamarin.Google.Android.Material. Install/reference Xamarin.Google.Android.Material 1.6.0 directly to project AndroidProject to resolve this issue. AndroidProject -> Microsoft.Maui.Dependencies 6.0.548 -> Xamarin.Google.Android.Material (>= 1.6.0) AndroidProject -> Xamarin.Forms 5.0.0.2545 -> Xamarin.Google.Android.Material (>= 1.4.0.2 && < 1.5.0).

I'm nor sure if I can use Xamarin.Forms with Microsoft.Maui.Essentials together in my MonoGame Android project.

Should I install Xamarin.Google.Android.Material 1.6.0 without Xamarin.Forms or what does the error message mean?

I use Target Android version 13.0 (API level 33).

EDIT: I have installed Xamarin.Google.Android.Material and after that I have tried to install Xamarin.Forms but then I get a version conflict with another Xamarin package.

CodePudding user response:

I'm nor sure if I can use Xamarin.Forms with Microsoft.Maui.Essentials together in my MonoGame Android project.

We know that Xamarin.Forms is a nuget for xamarin forms, and Microsoft.Maui.Essentials is a part a maui. So, you cannot install them to the same app.

You should figure out whether your current app is a Xamarin Forms project or a MAUI. Then select the corresponding package according to your needs.

  • Related