Skip to content
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

Type com.google.gson.FieldNamingPolicy$5 is defined multiple times #13

Open
MichaelBadDinosaur opened this issue Sep 6, 2022 · 3 comments

Comments

@MichaelBadDinosaur
Copy link

Describe the bug
.NET 6 MAUI project build fails with Laerdal.DFu v1.20.15 installed via Nuget

1>Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net6.0-android\lp\1\jl\__reference__gson-2.8.6.jar:com/google/gson/FieldNamingPolicy$5.class
1>	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
1>	at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
1>Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net6.0-android\lp\1\jl\__reference__gson-2.8.6.jar:com/google/gson/FieldNamingPolicy$5.class
1>	at Version.fakeStackEntry(Version_3.3.28.java:0)
1>	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
1>	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
1>	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:27)
1>	at com.android.tools.r8.internal.Bj.b(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:2)
1>	at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
1>	at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:17)
1>	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:85)
1>	... 1 more
1>Caused by: com.android.tools.r8.internal.f: Type com.google.gson.FieldNamingPolicy$5 is defined multiple times: obj\Debug\net6.0-android\lp\1\jl\__reference__gson-2.8.6.jar:com/google/gson/FieldNamingPolicy$5.class, obj\Debug\net6.0-android\lp\151\jl\libs\ED64959F88B22E6D.jar:com/google/gson/FieldNamingPolicy$5.class
1>	at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
1>	at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
1>	at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:33)
1>	at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:10)
1>	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
1>	at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:6)
1>	at com.android.tools.r8.graph.B2$a.e(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
1>	at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:105)
1>	at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
1>	at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:25)
1>	at com.android.tools.r8.D8.d(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:606)
1>	at com.android.tools.r8.D8.c(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:1)
1>	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:24)
1>	... 5 more
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.D8.targets(79,5): error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net6.0-android\lp\1\jl\__reference__gson-2.8.6.jar : com/google/gson/FieldNamingPolicy$5.class
1>Done building project "MauiApp1.csproj" -- FAILED.

To Reproduce
Steps to reproduce the behavior:

  1. Open Visual Studio and create a .NET MAUI APP
  2. Install Laerdal.DFu v1.20.15 installed via Nuget
  3. Rebuild solution

Desktop (please complete the following information):
Microsoft Visual Studio Community 2022 (64-bit) - Version 17.3.3
Windows 11 Pro

@ianbaddino
Copy link

any update on this?

@turbo25mike
Copy link

I am just now switching to MAUI and see this issue. Did anyone find a work around for this?

@VNGames
Copy link

VNGames commented Aug 20, 2023

Same on Xamarin

But I fixed it by removing Google.Json nuget I have added earlier (don't remember for what and why)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants