Closed jfversluis closed 1 year ago
/azp run
~Blocked until a dependency package is added to the proprietary feed~ Should be done
there were a large number of AndroidX updates last week. Please also make sure this compiles
@jfversluis Any chance of clearing the last failed checks?
I'm working on it!
/azp run
The build finally works hooray! Can someone that is watching this grab the NuGets from this build and try and see how that behaves on their Xamarin.Forms projects? @mos379 @MagicAndre1981 @kcrg @DouglasGiovanella
Instructions can be found here: https://github.com/xamarin/Xamarin.Forms/wiki/Preview-Packages#pull-requests-
My app builds in release mode with this fix. The error from this issue: https://github.com/xamarin/Xamarin.Forms/issues/15668 not occuring anymore.
My app builds in release mode with this fix. The error from this issue: #15668 not occuring anymore.
yes, the nugets 5.0.0.8488 work.
I only get NU1608 warnings about AndroidX nugets out of allowed version ranges. This should be fixed in a 2nd PR to not make this PR too large.
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8488 requires Xamarin.AndroidX.Lifecycle.LiveData (>= 2.3.1.1 && <= 2.5.1.1) but version Xamarin.AndroidX.Lifecycle.LiveData 2.6.1 was resolved.
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8488 requires Xamarin.AndroidX.Browser (>= 1.3.0.6 && < 1.4.0) but version Xamarin.AndroidX.Browser 1.5.0 was resolved.
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8488 requires Xamarin.AndroidX.Navigation.UI (>= 2.3.5.1 && < 2.4.0) but version Xamarin.AndroidX.Navigation.UI 2.5.3.1 was resolved.
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8488 requires Xamarin.AndroidX.RecyclerView (>= 1.2.1.1 && < 1.3.0) but version Xamarin.AndroidX.RecyclerView 1.3.0 was resolved.
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8488 requires Xamarin.Google.Android.Material (>= 1.4.0.2 && < 1.5.0) but version Xamarin.Google.Android.Material 1.8.0 was resolved.
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8488 requires Xamarin.AndroidX.Core (>= 1.6.0.1 && <= 1.9.0.1) but version Xamarin.AndroidX.Core 1.9.0.2 was resolved.
I'd rather fix everything that has to do with this right now :)
Where do you see this warning? Is this on your own project? Then you'll have to update the dependencies on that project, not much I can do about that unless we drop the bottom of the range for these packages which I don't really would want to do.
I guess this needs some updating: https://github.com/xamarin/Xamarin.Forms/pull/15718/files#diff-a10b47d2a1fb6f9a0f879b70a6b268191496328089b0bd5776fcbd68759d59dbR18-R29
I see this in error list as warnings and I did manual androidx updates so I have higher versions compared to what XF defines in the nuspec.
Those warnings will show up from time to time when new androidx versions are released and the version is outside of the defined range.
@MagicAndre1981 pushed an update for that. If this is done building, could you give that another try?
could you give that another try?
now I only get 1 warning:
Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Forms 5.0.0.8491 requires Xamarin.AndroidX.Lifecycle.LiveData (>= 2.3.1.1 && <= 2.5.1.2) but version Xamarin.AndroidX.Lifecycle.LiveData 2.6.1 was resolved.
You'll likely also need to check all other nuspec files (maps, dual screen which I don't use) and look that the referenced androidx version and versonges that they match.
Maybe also use the dependabot here that checks for new androidx lib updates in future to detect such issues earlier and be able to react faster. Can this bot also update the nuspecs?
@jfversluis I can't compile my app in release mode (full linking, custom profiled AOT) using XF 5.0.0.8491. I don't override any AndroidX packages.
Edit: I found workaround, just added Xamarin.AndroidX.AppCompat 1.6.1 to my android project. After that everything builds and works.
ok, so dependency id
entries for Xamarin.AndroidX.AppCompat/Xamarin.AndroidX.AppCompatResources in Version 1.6.1 needs to be added. to nuspec
Maybe also use the dependabot here that checks for new androidx lib updates in future to detect such issues earlier and be able to react faster. Can this bot also update the nuspecs?
Appreciate the idea, but I don't think we want to do that. The reason we're so careful with these dependency versions is because in the past this has introduced breaking changes, that is why we limit the scope to a certain set of which we are sure that it will work with our version of Forms.
In this case, I will have to bump the versions as we're touching a lot now anyway, but I'm not super happy about it 😄 the closer we get to May 2024, when support ends, the more careful we want to be with breaking changes.
Updated the versions some more and also added that AppCompat version >= 1.6.0
can you configure the boot only generare drafts for AndroidX nugets and if build is green, simply close it without merging. Only when google breaks something and build fails check the PR, fix code/nuspecs and release a new XF update.
I am using the latest available version 5.0.0.2578 and I am getting below error. Can someone please update how to fix it!
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Platform.Android.ShellSearchView/ClipDrawableWrapper::.ctor(Android.Graphics.Drawables.Drawable)' in assembly: 'Xamarin.Forms.Platform.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper
@siddhant-maurya look a few comments up, that person had the same issue
@jfversluis Thanks for the quick response. I tried adding Xamarin.AndroidX.AppCompat 1.6.1 but after many attempts I am still getting the same error.
@siddhant-maurya you are using the wrong XF version. try 5.0.0.8491
I am not able to find XF version 5.0.0.8491 in Nuget pkg manager or anywhere else can you please suggest how to get it. Iam using VS 2022 17.5.4
add this feed as nuget source: https://aka.ms/forms-prs/index.json to get the nugets for Pull Requests
I have upgraded to XF version 5.0.0.8491 but now it's giving me some other errors - Any idea what is causing this error?
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215: The Java type
javax.inject.Injectis generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Injectgenerated by: Javax.Inject.IInject, Scanbot.Xamarin.SDK.Dependencies, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Injectgenerated by: JavaX.Inject.IInject, Xamarin.JavaX.Inject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215: The Java type
javax.inject.Namedis generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Namedgenerated by: Javax.Inject.INamed, Scanbot.Xamarin.SDK.Dependencies, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Namedgenerated by: JavaX.Inject.INamed, Xamarin.JavaX.Inject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215: The Java type
javax.inject.Provideris generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Providergenerated by: Javax.Inject.IProvider, Scanbot.Xamarin.SDK.Dependencies, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Providergenerated by: JavaX.Inject.IProvider, Xamarin.JavaX.Inject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215: The Java type
javax.inject.Qualifieris generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Qualifiergenerated by: Javax.Inject.IQualifier, Scanbot.Xamarin.SDK.Dependencies, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Qualifiergenerated by: JavaX.Inject.IQualifier, Xamarin.JavaX.Inject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215: The Java type
javax.inject.Scopeis generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Scopegenerated by: Javax.Inject.IScope, Scanbot.Xamarin.SDK.Dependencies, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Scopegenerated by: JavaX.Inject.IScope, Xamarin.JavaX.Inject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215: The Java type
javax.inject.Singletonis generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Singletongenerated by: Javax.Inject.ISingleton, Scanbot.Xamarin.SDK.Dependencies, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1509,3): error XA4215:
javax.inject.Singletongenerated by: JavaX.Inject.ISingleton, Xamarin.JavaX.Inject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
remove this Scanbot.Xamarin.SDK.Dependencies and only use official AndroidX libs from Xamarin team
got it removed the Scanbot SDK and worked ! Thanks a lot :)
nice to hear this and build is green again 🥳 @jfversluis
Yeah it seems like LiveData 2.6.1 is causing issues, so I think I will go with this for now
ok, I tested 5.0.0.8503 and for me it works and I only get the now expected LiveData out of range warning
It's weird that it let's you install the latest version though because I limit it through the nuspec. Is that not enforced anymore? Did that change?
I don't configure that warnings are treated as errors, so this works.
I created a complete new app in VS2022 without any additional androidx references, updated to 5.0.0.8503 and see those warnings:
Warning NU1605 Detected package downgrade: Xamarin.AndroidX.CustomView from 1.1.0.14 to 1.1.0.7. Reference the package directly from the project to select a different version.
XFDemoApp.Android -> Xamarin.Forms 5.0.0.8503 -> Xamarin.AndroidX.AppCompat 1.6.0 -> Xamarin.AndroidX.Fragment 1.5.5 -> Xamarin.AndroidX.ViewPager 1.0.0.15 -> Xamarin.AndroidX.CustomView (>= 1.1.0.14)
XFDemoApp.Android -> Xamarin.Forms 5.0.0.8503 -> Xamarin.AndroidX.CustomView (>= 1.1.0.7 && < 1.2.0) XFDemoApp.Android
Warning NU1605 Detected package downgrade: Xamarin.AndroidX.Core from 1.9.0.1 to 1.6.0.1. Reference the package directly from the project to select a different version.
XFDemoApp.Android -> Xamarin.Forms 5.0.0.8503 -> Xamarin.AndroidX.AppCompat 1.6.0 -> Xamarin.AndroidX.Core (>= 1.9.0.1)
XFDemoApp.Android -> Xamarin.Forms 5.0.0.8503 -> Xamarin.AndroidX.Core (>= 1.6.0.1 && < 2.0.0)
Warning NU1605 Detected package downgrade: Xamarin.AndroidX.CustomView from 1.1.0.14 to 1.1.0.7. Reference the package directly from the project to select a different version.
XFDemoApp.Android -> Xamarin.Forms 5.0.0.8503 -> Xamarin.AndroidX.AppCompat 1.6.0 -> Xamarin.AndroidX.DrawerLayout 1.1.1.10 -> Xamarin.AndroidX.CustomView (>= 1.1.0.14)
XFDemoApp.Android -> Xamarin.Forms 5.0.0.8503 -> Xamarin.AndroidX.CustomView (>= 1.1.0.7 && < 1.2.0)
Hm yeah I probably need to update the templates as well to use this new version directly. And maybe some blog post or something to explain what is going on here 😅
yes, this is a breaking change that should be tested and documented well.
A bit offtopic, maybe also retarget Essentials to 13.0 to match the new XF version.
How does one get this before it makes its way to NuGet?
How does one get this before it makes its way to NuGet?
there are preview nugets packages on nuget.org
@jfversluis when are we to expect a release version that includes these changes? the deadline for app submissions is looming...
bump @jfversluis @jamesmontemagno
hello? @jfversluis @jamesmontemagno
I suspect it takes some time for 3rd party control vendors to update their libs as they also need to rebuild their controls for MAUI. Syncfusion is known to always target old XF / MAUI versions and I guess they may need some time to test their controls against new AndroidX libs.
This builds Xamarin.Forms with the MonoAndroid 13.0 target. With this we can now use the latest Android(X) packages again and should be more prepared for future Android versions and targets.
However, this change is pretty significant as also a lot of the dependencies got a good bump in their version numbers. Please test your code carefully!
Fixes #15668 Fixes #15678 Fixes #15677 Fixes #15714
Also see https://github.com/xamarin/Essentials/pull/2087