Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Build exception with latest MAUI #796

Closed
SokoFromNZ opened this issue Jul 24, 2023 · 3 comments
Closed

Build exception with latest MAUI #796

SokoFromNZ opened this issue Jul 24, 2023 · 3 comments

Comments

@SokoFromNZ
Copy link

Hi guys,

I'm trying to implement the In-App Update feature into our .NET MAUI app using your NuGet Xamarin.Google.Android.Play.App.Update.

But just by adding the upper NuGet package the app does not compile anymore (see below).
I've found this issue over at AndroidX with a similar exception but none of the workaround or tips did work for me...

Would be great if someone can point me in the right direction on how to get this working.

Thanks
Soko

MAUI.Android Version:

Latest shipped with Visual Studio 17.6.5

Operating System & Version:

Android API 33

Google Play Services Version

  • Xamarin.Google.Android.Play.App.Update v2.1.0.2

Describe your Issue

Relevant information

Links to the existing code: https://github.com/SokoFromNZ/InAppUpd

	<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
		<PackageReference Include="Xamarin.Google.Android.Play.App.Update" Version="2.1.0.2" />
	</ItemGroup>

Minimal Repro Code Sample

  • Create an empty/default .NET MAUI app with Visual Studio 17.6.5
  • Add NuGet package Xamarin.Google.Android.Play.App.Update to it
  • Build

Include any relevant Exception Stack traces, build logs, adb logs:

1>MSBUILD : java.exe error JAVA0000: Error in C:\Users\soko\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class:
1>MSBUILD : java.exe error JAVA0000: Type androidx.lifecycle.DispatchQueue is defined multiple times: C:\Users\soko\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class, obj\Debug\net7.0-android\lp\140\jl\classes.jar:androidx/lifecycle/DispatchQueue.class
1>MSBUILD : java.exe error JAVA0000: Compilation failed
1>MSBUILD : java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\soko\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar
1>MSBUILD : java.exe error JAVA0000: androidx/lifecycle/DispatchQueue.class
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:98)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.main(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4)
1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\soko\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class
1>MSBUILD : java.exe error JAVA0000: 	at Version.fakeStackEntry(Version_3.3.75.java:0)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:75)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:28)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:27)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.b(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:2)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:22)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:17)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:85)
1>MSBUILD : java.exe error JAVA0000: 	... 1 more
1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.internal.f: Type androidx.lifecycle.DispatchQueue is defined multiple times: C:\Users\soko\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class, obj\Debug\net7.0-android\lp\140\jl\classes.jar:androidx/lifecycle/DispatchQueue.class
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.JT.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:14)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.JT.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:22)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:33)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:10)
1>MSBUILD : java.exe error JAVA0000: 	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:6)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.graph.B2$a.e(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.b.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:110)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.b.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:28)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:25)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.d(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:606)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.c(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:1)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:24)
1>MSBUILD : java.exe error JAVA0000: 	... 5 more
1>MSBUILD : java.exe error JAVA0000: Directory 'obj\Debug\net7.0-android\lp\140' is from 'androidx.lifecycle.lifecycle-runtime-ktx.aar'.
1>Done building project "InAppUpd.csproj" -- FAILED.
@tristanhollman
Copy link

tristanhollman commented Jul 26, 2023

I ran into the same issue after upgrading the package "Xamarin.Firebase.Messaging" to the latest version (123.1.2.2).
Also working with the latest (preview) version of .NET MAUI.

The workaround mentioned here did help me solve/work around the issue, for now at least.

@SokoFromNZ
Copy link
Author

Thanks... it seems to work (for now at least ;) )

@jpobst
Copy link
Contributor

jpobst commented Jul 27, 2023

Details and workarounds documented here: dotnet/android-libraries#764.

@jpobst jpobst closed this as completed Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants