Essentials: Unable to upgrade Android Packages Above Versions 27.0.2.1

Created on 24 Jan 2019  路  7Comments  路  Source: xamarin/Essentials

Description

I was using Android.Compat at 28.0.0.1 version but to install essentials I need to downgrade it from 28.0.0.1 to 27.0.2.1

Steps to Reproduce

  1. Install Xamarin.Essentials for Xamarin.Android with using the updated Libraries of AppCompat and other Android Libraries.
  2. To Install Essentials, Downgrade the Libraries to 27.0.2.1.

Expected Behavior

It should work with all the libraries above minimum versions required.

Actual Behavior

Throwing

Error NU1107 Version conflict detected for Xamarin.Android.Support.Compat. Install/reference Xamarin.Android.Support.Compat 28.0.0.1 directly to project Abc.Android to resolve this issue.
Abc.Android -> Xamarin.Android.Support.v7.MediaRouter 28.0.0.1 -> Xamarin.Android.Support.v7.Palette 28.0.0.1 -> Xamarin.Android.Support.Compat (= 28.0.0.1)
Abc.Android -> Xamarin.Android.Support.Design 27.0.2.1 -> Xamarin.Android.Support.Compat (= 27.0.2.1). Abc.Android

Basic Information

  • Essential Version with issue: 1.0.1
  • IDE: Visual Studio 2017, Version 15.9.5
  • Android Support Library Version: 27.0.2.1 (Supported) and 28.0.0.1 (Not Supported)

Most helpful comment

YOu can modify your csproj and add:

   <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Essentials" Version="1.0.1" />

All 7 comments

This is due to a limitation in NuGet where it doesn't properly resolve versions.

Just make sure you have Xamarin.Android.Support.Compat and Xamarin.Android.Support.CustomTabs installed first. Install the 28 packages, and then install Essentials.

I tried it using this way as well but nuget didn't install Essentials then.

YOu can modify your csproj and add:

   <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Essentials" Version="1.0.1" />

I had applied the same, but still it is throwing me same error.

By default we installed: 27.0.2.1

I did file -> new

I added: Xamarin.Android.Support.CustomTabs -> 27.0.2.1 and then Xamarin.Android.Support.Compat -> 27.0.2.1

Then I updated all of them and it worked great. Here is
App7.zip

@mattleibow @jamesmontemagno Is this a Nuget issue ('does not resolve versions properly') or a Xamarin issue (why downgrade and then upgrade again)?
_I would prefer to add Xamarin.Essentials without any magic wand_ In my project, I have EFCore2.2 and Xamarin.Forms 3.5.0.... and I am 100% sure, if I start down- and upgrade things, my project will not work anymore - due to unknown reasons. : \

This is a nuget issue. Simple use the stuff I have here: https://github.com/xamarin/Essentials/issues/687#issuecomment-457671569

Was this page helpful?
0 / 5 - 0 ratings