-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet new mauilib
redistributes guava-listenablefuture.jar
#1312
Comments
yes https://github.com/xamarin/AndroidX/tree/template-sets-guava but I am having issues with binderator limitations and guava versioning (binderator wants 9999.0-empty-to-avoid-conflict-with-guava, but our bindings were against 1.0) |
That's already discussed to no end in xamarin/GooglePlayServicesComponents#379. I assume it would make sense to create the "empty" 9999.0-empty-to-avoid-conflict-with-guava NuGet for parity with what Google does in the Maven world. I am not sure what are the NuGet rules for version upgrading though and whether it would lead to inadvertently consuming this version of the asset. Alternatively you could probably introduce some property to force any version of Xamarin.Android.Guava.ListenableFuture [from now on] to be no-op. Then use this new property in dependencies instead of the |
@filipnavara I am afraid that would be ABI breakage, because it was built against 1.0 which is full API (correct me if I am wrong) https://github.com/xamarin/XamarinComponents/blob/main/Android/Guava/build.cake#L8 |
My idea was to build both 1.0.x NuGet like you do now but also the manually build the fake empty It's an orthogonal, but related, to this issue though. One can already fake the reference to |
binderator analyzes POM files and determines dependencies Guava bindings were done manually, so v1.0 was chosen (why? I can only guess, most likely with best intentions). Google leaves an option to pick, so we could do that only I am breaking my head how to build both 1.0 and 9999 with binderator AND leave 1.0 as dependency for packages. |
Fixes: xamarin#1312 If you do: $ mkdir foo ; cd foo $ dotnet new mauilib $ dotnet pack You end up redistributing `com.google.common.util.concurrent.ListenableFuture` in your MAUI class library NuGet package: * `foo.1.0.0.nupkg` * `lib\net6.0-android31.0\foo.aar` * `libs\78C2212B1AE12Ed.jar` * `com\google\common\util\concurrent\ListenableFuture.class` I tracked this down to here: https://github.com/xamarin/XamarinComponents/blob/3a9b39733fbd5a5359386ccecbd5f890eb391b1f/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets#L3-L5 I believe this needs to check `'$(AndroidApplication)' == 'true'`, same as we do in AndroidX: https://github.com/xamarin/AndroidX/blob/ef55d3c8c31c322fedf7fd328afc58ea576035ce/source/AndroidXTargets.cshtml#L51-L53 Let's fix this one package for now, and it might be worth auditing other packages in this repo later on.
Fixes: #1312 If you do: $ mkdir foo ; cd foo $ dotnet new mauilib $ dotnet pack You end up redistributing `com.google.common.util.concurrent.ListenableFuture` in your MAUI class library NuGet package: * `foo.1.0.0.nupkg` * `lib\net6.0-android31.0\foo.aar` * `libs\78C2212B1AE12Ed.jar` * `com\google\common\util\concurrent\ListenableFuture.class` I tracked this down to here: https://github.com/xamarin/XamarinComponents/blob/3a9b39733fbd5a5359386ccecbd5f890eb391b1f/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets#L3-L5 I believe this needs to check `'$(AndroidApplication)' == 'true'`, same as we do in AndroidX: https://github.com/xamarin/AndroidX/blob/ef55d3c8c31c322fedf7fd328afc58ea576035ce/source/AndroidXTargets.cshtml#L51-L53 Let's fix this one package for now, and it might be worth auditing other packages in this repo later on.
Context: xamarin/XamarinComponents#1312 Context: xamarin/XamarinComponents@0874b32 Context: https://www.nuget.org/packages/Xamarin.Google.Guava.FailureAccess/1.0.1.5 Context: https://www.nuget.org/packages/Xamarin.Google.Guava.ListenableFuture/1.0.0.5 If you do: $ mkdir foo ; cd foo $ dotnet new mauilib $ dotnet pack You end up redistributing `com.google.common.util.concurrent.ListenableFuture` in your MAUI class library NuGet package: * `foo.1.0.0.nupkg` * `lib\net6.0-android31.0\foo.aar` * `libs\78C2212B1AE12Ed.jar` * `com\google\common\util\concurrent\ListenableFuture.class` This was fixed in XamarinComponents and pushed to NuGet.org, but we need to update the AndroidX dependencies for the new versions.
I am working with .NET MAUI and recently migrated from Preview 14 to the current RC1 branch. When trying to compile my app, I get an error that also references listenablefuture.class... is this in any way connected to the issue discussed here? This is my build output: |
@Mephisztoe I have the same issue, have you found any solution? |
@Mephisztoe @Csaba8472 it probably means one of your dependencies was built with an older Xamarin.Google.Guava.ListenableFuture, and it needs to be rebuilt now. You probably have a package that "accidentially" redistributed that |
I'm working on a MAUI app which needs Microsoft.Identity.Client. Before rc1 it worked properly with my modifications, and as you've written after I've rebuilt Xamarin.Google.Guava.ListenableFuture and added to the project it works again. Thank you! |
If you do:
You get a weird
.jar
file included in your library:I tracked this down to here:
XamarinComponents/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets
Lines 3 to 5 in 3a9b397
I believe this needs to check
Condition=" '$(AndroidApplication)' == 'true' "
, same as:https://github.com/xamarin/AndroidX/blob/ef55d3c8c31c322fedf7fd328afc58ea576035ce/source/AndroidXTargets.cshtml#L51-L53
The text was updated successfully, but these errors were encountered: