Xamarin.Forms
Xamarin.Forms copied to clipboard
[Bug] AndroidX dependencies cannot be updated
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?
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.
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?
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.
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:
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
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.
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.
Any update ? Since Xamarin.Forms is still supported, I think it should be updated to support the latest androidx packages, as often as possible.
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.
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?
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
Any update ? Are you going to release an update of Xamarin.Forms and Xamarin.Essentials soon ?
@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.
Microsoft is now updating some AndroidX dependencies and this fix is scheduled for 5.0 SR13
@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.
[...] 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)'.