Repository navigation
Closed
Description
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:

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
- Create new project using ".NET MAUI App" template.
- Install latest Xamarin.AndroidX.Core.SplashScreen to your just created project.
- 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 ==========Reacted by José Luis
Metadata
Metadata
Assignees
Labels
No labels
Activity
moljac commentedon Jul 7, 2023
@sowacx
Thanks for the feedback.
I cannot repro on
net8.0-androidpreview.sowacx commentedon Jul 10, 2023
Hello,
Here is solution that I made from Maui template for net7.0-android.
https://github.com/sowacx/AndroidXSplashScreen
moljac commentedon Jul 11, 2023
@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.csprojdotnet build \ net7.0/begin/AppMAUI.Issue752_KotlinGeneratedByMoreThan/AppMAUI.Issue752_KotlinGeneratedByMoreThan.csprojSeems like transitive dependencies depend on
kotlin-stdlib
1.7.20.1(9 months)https://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.7.20.1
and
kotlin-stdlib
1.8.0.1(6 months)https://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.8.0.1
kotlin-stdlib
1.8.20.1(2 months - after alignment bumps)https://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.8.20.1
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.csprojmoljac commentedon Jul 11, 2023
Repro sample
752-MAUI-Kotlin-generated-by-more-than-one-managed-type.zip
moljac commentedon Jul 11, 2023
@sowacx
Would you be so kind and post results of
here, please??
thanks
moljac commentedon Jul 11, 2023
net8.0 builds ok
kotlin-stdlibusedhttps://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.8.0.1
https://www.nuget.org/packages/Xamarin.Kotlin.StdLib/1.8.20.1
sowacx commentedon Jul 15, 2023
Hey @moljac,
I was testing on two machines, first one is win11-x64 and workload list for that machine is:
Second one for mac-arm:
moljac commentedon Jul 25, 2023
Related
dotnet/android#7699
dotnet/android#8209
sowacx commentedon Jul 25, 2023
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.
moljac commentedon Jul 26, 2023
Can you please post all packageReferences, please?
moljac commentedon Jul 27, 2023
Yes, explicit PackageReferences help in general, but there are also cases where it does not help.
Not yet. I need to examine dependency tree/forest.
This worked for me in previously attached sample (
net6.0andnet7.0):I will add newer sample tomorrow.
sowacx commentedon Jul 28, 2023
Thank you @moljac!
I linked those two packages as you wrote and looks that is building fine!
moljac commentedon Oct 16, 2023
closing this issue!