Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] AndroidX dependencies cannot be updated #15402

Closed
tranb3r opened this issue Jun 7, 2022 · 15 comments · Fixed by #15611
Closed

[Bug] AndroidX dependencies cannot be updated #15402

tranb3r opened this issue Jun 7, 2022 · 15 comments · Fixed by #15611
Labels
p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.

Comments

@tranb3r
Copy link

tranb3r commented Jun 7, 2022

XF SR10 (5.0.0.2401) depends on old versions of AndroidX.
For example, it's stuck with Xamarin.AndroidX.Core < 1.7.0.
Could you please update AndroidX dependencies?

@tranb3r tranb3r added s/unverified New report that has yet to be verified t/bug 🐛 labels Jun 7, 2022
@MagicAndre1981
Copy link
Contributor

you can install the AndroidX packages manually to have better control on which package is used. Beside the NU1608 warning, our apps still work so far:

NU1608: Detected package version outside of dependency constraint: Xamarin.Essentials 1.7.3 requires Xamarin.AndroidX.Browser (>= 1.3.0.5 && < 1.4.0) but version Xamarin.AndroidX.Browser 1.4.0.2 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2401 requires Xamarin.AndroidX.Lifecycle.LiveData (>= 2.3.1.1 && < 2.4.0) but version Xamarin.AndroidX.Lifecycle.LiveData 2.4.1.2 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2401 requires Xamarin.Google.Android.Material (>= 1.4.0.2 && < 1.5.0) but version Xamarin.Google.Android.Material 1.6.1.1 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2401 requires Xamarin.AndroidX.Browser (>= 1.3.0.6 && < 1.4.0) but version Xamarin.AndroidX.Browser 1.4.0.2 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2401 requires Xamarin.AndroidX.Core (>= 1.6.0.1 && < 1.7.0) but version Xamarin.AndroidX.Core 1.8.0.1 was resolved.

@jfversluis
Copy link
Member

The latest Xamarin.Forms version had a minor bump. We're pinning these versions on purpose because in the past we have been surprised by breaking changes on the Android side.

What version would you like to see added?

@jfversluis jfversluis added p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. and removed s/unverified New report that has yet to be verified t/bug 🐛 labels Jun 15, 2022
@tranb3r
Copy link
Author

tranb3r commented Jun 15, 2022

Thanks for answering Gerald :)

I've had a lot of conflicts in the past, especially with Xamarin.Firebase.* requiring higher versions than Xamarin.Forms.

I think right now it's kind of ok:

  • Xamarin.Forms 5.0.0.2478 -> Xamarin.AndroidX.Core <= 1.7.0.2
  • Xamarin.Firebase.Messaging 122.0.0.6 -> Xamarin.AndroidX.Core >= 1.7.0.2

I know it's impossible to reference the latest AndroidX versions in all packages. But I think it would be better to make it as much as possible consistent between Xamarin packages.

@beeradmoore
Copy link
Contributor

I have a (possibly bad) habit of updating packages to the latest versions before I have the chance to see if any of the issues in there effect me.

As tranb3r said, Xamarin.Forms 5.0.0.2478 has a dependency on Xamarin.AndroidX.Core (>= 1.6.0.1 && <= 1.7.0.2)

My project has references to Xamarin.AndroidX.Activity 1.4.0.3 and Xamarin.AndroidX.RecyclerView 1.2.1.6.

There are two updates to these packages:

  • Xamarin.AndroidX.Activity 1.4.0.4
  • Xamarin.AndroidX.RecyclerView 1.2.1.7

Both of which reference Xamarin.AndroidX.Core >= 1.8.0.1. But then this can't be updated to because of the Xamarin.Forms dependency on Xamarin.AndroidX.Core >= 1.6.0.1 && <= 1.7.0.2

@Rob97
Copy link

Rob97 commented Jun 21, 2022

Having the same issues as listed above. And this is preventing me from transitioning to .NET MAUI because I need to be on the latest Xamarin.Forms to do so successfully. Here is my error:

Xamarin.Forms 5.0.0.2478 requires Xamarin.AndroidX.Core (>= 1.6.0.1 && <= 1.7.0.2) but version Xamarin.AndroidX.Core 1.8.0.1 was resolved.

Both are the latest versions of each package basically meaning I can't update.

@MagicAndre1981
Copy link
Contributor

Here is my error:

Xamarin.Forms 5.0.0.2478 requires Xamarin.AndroidX.Core (>= 1.6.0.1 && <= 1.7.0.2) but version Xamarin.AndroidX.Core 1.8.0.1 was resolved.

As I said, this only shows a warning, so you may have configured "treat warnings as errors", so turn this off and continue compile if you get warnings.

@tranb3r
Copy link
Author

tranb3r commented Aug 24, 2022

Any update ?
Since Xamarin.Forms is still supported, I think it should be updated to support the latest androidx packages, as often as possible.

@tentom
Copy link

tentom commented Sep 1, 2022

A bump to support Xamarin.AndroidX.Core 1.8.0.1 would be nice, then AndroidX.Framework 1.5.1 could be installed without doing it manually and that seems to fix some bugs that causes apps to crash.

The problem was related to the AndroidX.Fragment package and a fix was added in version 1.5.1 with was not possible to upgrade to out of the box (need manual upgrade due to the constraints) and the accompanying warning.

Upgrading to AndroidX.Fragment 1.5.1 fixed this issue for me #13895
Issue #14193 seems to be closely related to this issue and might be a duplicate.

@F-Goncalves
Copy link

It's so damn frustrating not being able to update packages that depend on Xamarin.AndroidX.Core >= 1.8.0.1.
Is there no workaround for this issue?

@MagicAndre1981
Copy link
Contributor

Is there no workaround for this issue?

simply install the latest Xamarin AndroidX packages on your on to the Android project and ignore the NU1608 warnings

@tranb3r
Copy link
Author

tranb3r commented Oct 25, 2022

Any update ?
Are you going to release an update of Xamarin.Forms and Xamarin.Essentials soon ?

@Rob97
Copy link

Rob97 commented Nov 22, 2022

@tranb3r I figured it out. Here is the link. To update the packages, you will have to remove them completely and install the exact versions listed here: https://github.com/MicrosoftDocs/azure-dev-docs/issues/929

You will bump into further issues regarding the documentation and firebase code. The link above walks you through those.

@MagicAndre1981
Copy link
Contributor

Microsoft is now updating some AndroidX dependencies and this fix is scheduled for 5.0 SR13

@MagicAndre1981
Copy link
Contributor

MagicAndre1981 commented Sep 18, 2023

@jfversluis

some AndroidX packages are now updated and again outside of dependency constraint:

NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2612 requires Xamarin.AndroidX.Lifecycle.LiveData (>= 2.3.1.1 && <= 2.6.1.1) but version Xamarin.AndroidX.Lifecycle.LiveData 2.6.2.1 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2612 requires Xamarin.Google.Android.Material (>= 1.4.0.2 && < 1.9.0) but version Xamarin.Google.Android.Material 1.9.0.3 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2612 requires Xamarin.AndroidX.Browser (>= 1.3.0.6 && < 1.6.0) but version Xamarin.AndroidX.Browser 1.6.0.1 was resolved.
NU1608: Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.2612 requires Xamarin.AndroidX.Navigation.UI (>= 2.3.5.1 && < 2.6.0) but version Xamarin.AndroidX.Navigation.UI 2.7.2.1 was resolved.

@daef
Copy link

daef commented Sep 26, 2023

[...] ignore the NU1608 warnings

to me this shows as an error:

Severity	Code	Description	Project	File	Line	Suppression State
Error		Unable to resolve dependencies. 'Xamarin.AndroidX.Browser 1.6.0.1' is not compatible with 'Xamarin.Forms 5.0.0.2612 constraint: Xamarin.AndroidX.Browser (>= 1.3.0.6 && < 1.6.0)'.				

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants