Repository navigation
Description
Version Information
- VSMac Preview 17.0 build 7303
- Xamarin.Android 12.2.99.75
- Using AndroidX or Support Libraries:
- net6-android
Description
Duplicate of #505
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.7.0" />
<PackageReference Include="Xamarin.AndroidX.Camera.Lifecycle" Version="1.0.2.3" />
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.0.2.3" />
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.0.0.5-alpha20" />
Describe your Issue:
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/31.0.200-preview.13.41/tools/Xamarin.Android.D8.targets(79,5): error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar : com/google/common/util/concurrent/ListenableFuture.class [/Users/imac/oweb/Mobile/Xamarin/Packages/ToToolkit/MAUI/Sample/ToToolkitSample/ToToolkitSample.csproj]
Caused by: com.android.tools.r8.internal.b: Type com.google.common.util.concurrent.ListenableFuture is defined multiple times: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class, obj/Debug/net6.0-android/lp/132/jl/libs/FCEFAF10B0757418.jar:com/google/common/util/concurrent/ListenableFuture.class
Build Logs
Determining projects to restore...
All projects are up-to-date for restore.
ToToolkit -> /Users/imac/oweb/Mobile/Xamarin/Packages/ToToolkit/MAUI/Source/bin/Debug/net6.0-android/ToToolkit.dll
ToToolkitSample -> /Users/imac/oweb/Mobile/Xamarin/Packages/ToToolkit/MAUI/Sample/ToToolkitSample/bin/Debug/net6.0-android/ToToolkitSample.dll
ToToolkit -> /Users/imac/oweb/Mobile/Xamarin/Packages/ToToolkit/MAUI/Source/bin/Debug/net6.0-android/ToToolkit.dll
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class
at com.android.tools.r8.utils.w.a(SourceFile:92)
at com.android.tools.r8.D8.main(D8.java:4)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class
at Version.fakeStackEntry(Version_3.0.73.java:0)
at com.android.tools.r8.utils.w.a(SourceFile:68)
at com.android.tools.r8.utils.w.a(SourceFile:28)
at com.android.tools.r8.utils.w.a(SourceFile:27)
at com.android.tools.r8.utils.w.b(SourceFile:3)
at com.android.tools.r8.D8.a(D8.java:17)
at com.android.tools.r8.D8.a(D8.java:15)
at com.android.tools.r8.utils.w.a(SourceFile:84)
... 1 more
Caused by: com.android.tools.r8.internal.b: Type com.google.common.util.concurrent.ListenableFuture is defined multiple times: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class, obj/Debug/net6.0-android/lp/132/jl/libs/FCEFAF10B0757418.jar:com/google/common/util/concurrent/ListenableFuture.class
at com.android.tools.r8.internal.UA.a(SourceFile:14)
at com.android.tools.r8.internal.UA.a(SourceFile:22)
at com.android.tools.r8.internal.Fw.b(SourceFile:6)
at com.android.tools.r8.internal.Fw.a(SourceFile:23)
at com.android.tools.r8.internal.Fw.a(SourceFile:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
at com.android.tools.r8.internal.Fw.a(SourceFile:6)
at com.android.tools.r8.graph.I0$c.f(SourceFile:3)
at com.android.tools.r8.dex.a.a(SourceFile:94)
at com.android.tools.r8.dex.a.a(SourceFile:23)
at com.android.tools.r8.D8.a(D8.java:21)
at com.android.tools.r8.D8.d(D8.java:11)
at com.android.tools.r8.D8.c(D8.java:1)
at com.android.tools.r8.utils.w.a(SourceFile:24)
... 5 more
Steps to Reproduce
Steps to Reproduce (with link to sample solution if possible):
cameraview testing.zip
dotnet build -t:Run -f net6.0-android
Did you find any workaround?
No response
Relevant log output
No response
Activity
jonathanpeppers commentedon Mar 14, 2022
Problem is actually:
Contains
libs\FCEFAF10B0757418.jarinside, that is a copy of guava listenable future.jpobst commentedon Mar 14, 2022
We are testing a fix for MAUI. In the meantime, this set of packages seems to work for me locally:
xDaijobu commentedon Mar 15, 2022
hi @jpobst, this workaround works for me. Thanks
[android] update Xamarin.Google.Guava.ListenableFuture
[android] update to the latest AndroidX packages
pictos commentedon Mar 29, 2022
An update, this doesn't work with the latest version
[android] update to the latest AndroidX packages (#5588)
jonathanpeppers commentedon Mar 29, 2022
@pictos so we got dotnet/maui updated to the latest AndroidX, that should be in the next release. (RC 1?)
If anyone is using a classic Xamarin.Android project, can you try updating all packages to latest? If you still hit an issue we should investigate further.
pictos commentedon Mar 29, 2022
@jonathanpeppers thanks!
By classic Xamarin.Android you mean the old target or the .NET 6 one?
jonathanpeppers commentedon Mar 29, 2022
Either one, but I figured we might have more developers using stable Xamarin.Android right now.
petro2050 commentedon Mar 30, 2022
@jonathanpeppers I have this same exact problem with the following dependencies:
I'm trying to convert my XF app to maui.
jonathanpeppers commentedon Mar 30, 2022
@petro2050 are you using a build of MAUI that has dotnet/maui#5588? It's not released yet.
ziomek64 commentedon Apr 15, 2022
What is the current fix or workaround? I'm getting this:
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\mrady\.nuget\packages\xamarin.google.guava.listenablefuture\1.0.0.6\buildTransitive\net6.0-android31.0\..\..\jar\guava-listenablefuture.jar : com/google/common/util/concurrent/ListenableFuture.class MauiApp2 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.300-rc.1.4\tools\Xamarin.Android.D8.targets 79I started blank MAUI app and wanted to used mauicompat toolkit and I ran into the error above.
jonathanpeppers commentedon Apr 15, 2022
@ziomek64 it sounds like the Maui community toolkit needs to be recompiled with:
https://www.nuget.org/packages/Xamarin.Google.Guava.ListenableFuture/1.0.0.6
Which might just mean they need to recompile against MAUI RC 1.
pictos commentedon Apr 15, 2022
@ziomek64 FYI we plan to release new versions of Toolkit soon-sh
ziomek64 commentedon Apr 15, 2022
Can't wait as I do really need some features from compatmaui community toolkit
pictos commentedon Apr 18, 2022
@jonathanpeppers I tried to use the
CameraXon Maui RC1 and I'm facing this error again. I updated the packages to the following versions:The previous configuration, that worked for the last MAUI preview didn't work:
You can see the project here: https://github.com/CommunityToolkit/Maui/tree/pj/cameraView-initial-work
TBH, is very hard to know if the version is compatible, the error message isn't clear, it's a cat-mouse game :/
jonathanpeppers commentedon Apr 19, 2022
@jpobst do you see why the above Camera2 packages would still hit this? Is this the new Guava issue?
jpobst commentedon Apr 19, 2022
Is there any more error in the logs? The original issue on this report also contained the error that started with
Caused by:that says what the actual error is.jpobst commentedon Apr 19, 2022
We have released some updated Guava packages that provide "escape hatches" as a temporary workaround. You can try these and see if they resolve the issue:
#535
AleksandrUkrainets commentedon May 26, 2022
It was help me also!
Thanks!!!