xamarin / AndroidX

AndroidX bindings for .NET for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MAUI XA4214/XA4215 Xamarin.Kotlin.StdLib packages generated by more than one managed type

sowacx opened this issue · comments

Android application type

Not applicable

Affected platform version

.NET 6 / .NET 7

Description

Hello,
Are you supporting MAUI?
I added nuget package: Xamarin.AndroidX.Core.SplashScreen to maui boilerpate from VS 17.6.4 and I got issues like that:
image
I have tried with package versions: 1.0.1.1 (latest) and 1.0.0.3. and latest versions of sdks .NET 6 and 7.

Do you any workaround for that issue?

Steps to Reproduce

  1. Create new project using ".NET MAUI App" template.
  2. Install latest Xamarin.AndroidX.Core.SplashScreen to your just created project.
  3. Try to build

Did you find any workaround?

Not so far

Relevant log output

Build started...
1>------ Build started: Project: MauiSplashScreen, Configuration: Debug Any CPU ------
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>MauiSplashScreen -> X:\Praca\MauiSplashScreen\MauiSplashScreen\bin\Debug\net6.0-android\MauiSplashScreen.dll
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.485\tools\Xamarin.Android.Common.targets(1438,3): warning XA4214: The managed type `Kotlin.IO.Path.IExperimentalPathApi` exists in multiple assemblies: Xamarin.Kotlin.StdLib, Xamarin.Kotlin.StdLib.Jdk7. Please refactor the managed type names in these assemblies so that they are not identical.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.485\tools\Xamarin.Android.Common.targets(1438,3): warning XA4214: References to the type `Kotlin.IO.Path.IExperimentalPathApi` will refer to `Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib`.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.485\tools\Xamarin.Android.Common.targets(1438,3): error XA4215: The Java type `kotlin.io.path.ExperimentalPathApi` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.485\tools\Xamarin.Android.Common.targets(1438,3): error XA4215:   `kotlin.io.path.ExperimentalPathApi` generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.485\tools\Xamarin.Android.Common.targets(1438,3): error XA4215:   `kotlin.io.path.ExperimentalPathApi` generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib.Jdk7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
1>Done building project "MauiSplashScreen.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 11:20 PM and took 07.179 seconds ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
========== Deploy started at 11:20 PM and took 07.179 seconds ==========
commented

@sowacx

Thanks for the feedback.

I cannot repro on net8.0-android preview.

Hello,
Here is solution that I made from Maui template for net7.0-android.
https://github.com/sowacx/AndroidXSplashScreen

commented

@sowacx

Thanks a lot. I created my sample and was able to reproduce, but this sample of yours was helpful to compare the csproj files.

Cannot upload sample.

dotnet build \
    net6.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj 
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.485/tools/Xamarin.Android.Common.targets(1438,3): warning XA4214: The managed type `Kotlin.IO.Path.IExperimentalPathApi` exists in multiple assemblies: Xamarin.Kotlin.StdLib, Xamarin.Kotlin.StdLib.Jdk7. Please refactor the managed type names in these assemblies so that they are not identical. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net6.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net6.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.485/tools/Xamarin.Android.Common.targets(1438,3): warning XA4214: References to the type `Kotlin.IO.Path.IExperimentalPathApi` will refer to `Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib`. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net6.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net6.0-android]


/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.485/tools/Xamarin.Android.Common.targets(1438,3): error XA4215: The Java type `kotlin.io.path.ExperimentalPathApi` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net6.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net6.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.485/tools/Xamarin.Android.Common.targets(1438,3): error XA4215:   `kotlin.io.path.ExperimentalPathApi` generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net6.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net6.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.485/tools/Xamarin.Android.Common.targets(1438,3): error XA4215:   `kotlin.io.path.ExperimentalPathApi` generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib.Jdk7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net6.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net6.0-android]
dotnet build \
    net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj 
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): warning XA4214: The managed type `Kotlin.IO.Path.IExperimentalPathApi` exists in multiple assemblies: Xamarin.Kotlin.StdLib, Xamarin.Kotlin.StdLib.Jdk7. Please refactor the managed type names in these assemblies so that they are not identical. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): warning XA4214: References to the type `Kotlin.IO.Path.IExperimentalPathApi` will refer to `Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib`. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): warning XA4214: The managed type `Kotlin.IO.Path.IFileVisitorBuilder` exists in multiple assemblies: Xamarin.Kotlin.StdLib, Xamarin.Kotlin.StdLib.Jdk7. Please refactor the managed type names in these assemblies so that they are not identical. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): warning XA4214: References to the type `Kotlin.IO.Path.IFileVisitorBuilder` will refer to `Kotlin.IO.Path.IFileVisitorBuilder, Xamarin.Kotlin.StdLib`. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `kotlin.io.path.ExperimentalPathApi` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `kotlin.io.path.ExperimentalPathApi` generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `kotlin.io.path.ExperimentalPathApi` generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib.Jdk7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `kotlin.io.path.FileVisitorBuilder` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `kotlin.io.path.FileVisitorBuilder` generated by: Kotlin.IO.Path.IFileVisitorBuilder, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.68/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `kotlin.io.path.FileVisitorBuilder` generated by: Kotlin.IO.Path.IFileVisitorBuilder, Xamarin.Kotlin.StdLib.Jdk7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
    4 Warning(s)
    6 Error(s)

Seems like transitive dependencies depend on

Investigating further: moved types between maven packages.

Attempt to explicitly define kotlin package reference with version 1.8.21.1

dotnet build \
    net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj 
MSBUILD : java error JAVA0000: Error in /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib/1.8.21.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-1.8.21.jar:kotlin/collections/jdk8/CollectionsJDK8Kt.class: [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: Type kotlin.collections.jdk8.CollectionsJDK8Kt is defined multiple times: /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib/1.8.21.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-1.8.21.jar:kotlin/collections/jdk8/CollectionsJDK8Kt.class, /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib.jdk8/1.7.20.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-jdk8-1.7.20.jar:kotlin/collections/jdk8/CollectionsJDK8Kt.class [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: Compilation failed [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib/1.8.21.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-1.8.21.jar [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: kotlin/collections/jdk8/CollectionsJDK8Kt.class [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:98) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.D8.main(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib/1.8.21.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-1.8.21.jar:kotlin/collections/jdk8/CollectionsJDK8Kt.class [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at Version.fakeStackEntry(Version_3.3.75.java:0) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:75) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:28) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:27) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.b(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:2) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:22) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:17) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:85) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	... 1 more [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: Caused by: com.android.tools.r8.internal.f: Type kotlin.collections.jdk8.CollectionsJDK8Kt is defined multiple times: /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib/1.8.21.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-1.8.21.jar:kotlin/collections/jdk8/CollectionsJDK8Kt.class, /Users/moljac/.nuget/packages/xamarin.kotlin.stdlib.jdk8/1.7.20.1/buildTransitive/net6.0-android31.0/../../jar/org.jetbrains.kotlin.kotlin-stdlib-jdk8-1.7.20.jar:kotlin/collections/jdk8/CollectionsJDK8Kt.class [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.JT.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:14) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.JT.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:22) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:33) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:10) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:6) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.graph.B2$a.e(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.dex.b.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:110) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.dex.b.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:28) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:25) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.D8.d(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:606) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.D8.c(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:1) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:24) [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000: 	... 5 more [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
MSBUILD : java error JAVA0000:  [./752-MAUI-Kotlin-generated-by-more-than-one-managed-type/net7.0/end/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csproj::TargetFramework=net7.0-android]
    100 Warning(s)
    1 Error(s)
dotnet workload list

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
wasm-tools                 7.0.8/7.0.100          SDK 7.0.300        
maui-windows               7.0.86/7.0.100         SDK 7.0.300        
macos                      13.3.7067/7.0.100      SDK 7.0.300        
maui-maccatalyst           7.0.86/7.0.100         SDK 7.0.300        
maui-ios                   7.0.86/7.0.100         SDK 7.0.300        
maui-android               7.0.86/7.0.100         SDK 7.0.300        
ios                        16.4.7067/7.0.100      SDK 7.0.300        
maui-mobile                7.0.86/7.0.100         SDK 7.0.300        
maccatalyst                16.4.7067/7.0.100      SDK 7.0.300        
maui                       7.0.86/7.0.100         SDK 7.0.300        
tvos                       16.4.7067/7.0.100      SDK 7.0.300        
android                    33.0.68/7.0.100        SDK 7.0.300        
commented

@sowacx

Would you be so kind and post results of

dotnet workload list

here, please??

thanks

commented

net8.0 builds ok

kotlin-stdlib used

https://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.8.0.1
https://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.8.20.1

dotnet workload list  
Installed Workload Id      Manifest Version                               Installation Source  
-----------------------------------------------------------------------------------------------
wasm-tools                 8.0.0-preview.4.23259.5/8.0.100-preview.4      SDK 8.0.100-preview.4
maui-windows               8.0.0-preview.4.8333/8.0.100-preview.4         SDK 8.0.100-preview.4
macos                      13.3.8377-net8-p4/8.0.100-preview.4            SDK 8.0.100-preview.4
maui-maccatalyst           8.0.0-preview.4.8333/8.0.100-preview.4         SDK 8.0.100-preview.4
maui-ios                   8.0.0-preview.4.8333/8.0.100-preview.4         SDK 8.0.100-preview.4
maui-android               8.0.0-preview.4.8333/8.0.100-preview.4         SDK 8.0.100-preview.4
ios                        16.4.8377-net8-p4/8.0.100-preview.4            SDK 8.0.100-preview.4
maui-mobile                8.0.0-preview.4.8333/8.0.100-preview.4         SDK 8.0.100-preview.4
maccatalyst                16.4.8377-net8-p4/8.0.100-preview.4            SDK 8.0.100-preview.4
maui                       8.0.0-preview.4.8333/8.0.100-preview.4         SDK 8.0.100-preview.4
tvos                       16.4.8377-net8-p4/8.0.100-preview.4            SDK 8.0.100-preview.4
android                    34.0.0-preview.4.273/8.0.100-preview.4         SDK 8.0.100-preview.4

Hey @moljac,
I was testing on two machines, first one is win11-x64 and workload list for that machine is:

Installed Workload Id      Manifest Version                            Installation Source
------------------------------------------------------------------------------------------
maui-ios                   8.0.0-preview.3.8149/8.0.100-preview.3      VS 17.6.33815.320
ios                        16.2.462-net8-p3/8.0.100-preview.3          VS 17.6.33815.320
android                    34.0.0-preview.3.224/8.0.100-preview.3      VS 17.6.33815.320
maui-android               8.0.0-preview.3.8149/8.0.100-preview.3      VS 17.6.33815.320
maui-windows               8.0.0-preview.3.8149/8.0.100-preview.3      VS 17.6.33815.320
maui-maccatalyst           8.0.0-preview.3.8149/8.0.100-preview.3      VS 17.6.33815.320
maccatalyst                16.2.462-net8-p3/8.0.100-preview.3          VS 17.6.33815.320

Second one for mac-arm:

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui-maccatalyst           7.0.92/7.0.100        SDK 7.0.300
maui-ios                   7.0.92/7.0.100        SDK 7.0.300
maui-android               7.0.92/7.0.100        SDK 7.0.300
maui                       7.0.92/7.0.100        SDK 7.0.300

Hey @moljac In related issues people are suggesting some workaround like adding such package to proj:
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.0" />
I played with that, but without success. Do you know any potential workaround for that now?
I checked also lately released version of Xamarin.AndroidX.Core.SplashScreen (1.0.1.2), but same issue still appears.

commented

Hey @moljac In related issues people are suggesting some workaround like adding such package to proj:
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.0" />
I played with that, but without success. Do you know any potential workaround for that now?
I checked also lately released version of Xamarin.AndroidX.Core.SplashScreen (1.0.1.2), but same issue still appears.

Can you please post all packageReferences, please?

commented

Hey @moljac In related issues people are suggesting some workaround like adding such package to proj:
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.0" />

Yes, explicit PackageReferences help in general, but there are also cases where it does not help.

I played with that, but without success. Do you know any potential workaround for that now?

Not yet. I need to examine dependency tree/forest.

This worked for me in previously attached sample (net6.0 and net7.0):

		<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.2" />
		<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.9.0.1" />

I will add newer sample tomorrow.

I checked also lately released version of Xamarin.AndroidX.Core.SplashScreen (1.0.1.2), but same issue still appears.

Thank you @moljac!
I linked those two packages as you wrote and looks that is building fine!

closing this issue!