Skip to content

Updating two test projects to Xamarin.AndroidX.AppCompat Version 1.6.0 causes build failure #7699

Closed

Description

@gmck

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

VS 2022 17.5.0 Prev 2.0

Description

@jonpryor , @moljac

I just upgraded two test projects to Xamarin.AndroidX.AppCompat Version 1.6.0, no other changes and both projects fail to build with the following type of errors.

The projects are available at https://github.com/gmck/NavigationGraph7Net7 and https://github.com/gmck/PredictiveBackGesture. Both projects just need to have the AppCompat version updated to 1.6.0 for them to fail to build.

<style> </style>

 

Severity Code Description Project File Line Suppression State
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. PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
Warning XA4214 References to the type Kotlin.IO.Path.IExperimentalPathApi will refer to Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib. PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
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. PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
Warning XA4214 References to the type Kotlin.IO.Path.IFileVisitorBuilder will refer to Kotlin.IO.Path.IFileVisitorBuilder, Xamarin.Kotlin.StdLib. PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
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. PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
Error XA4215 kotlin.io.path.ExperimentalPathApi generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
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 PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
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. PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
Error XA4215 kotlin.io.path.FileVisitorBuilder generated by: Kotlin.IO.Path.IFileVisitorBuilder, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  
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 PredictiveBackGesture C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.4\tools\Xamarin.Android.Common.targets 1476  

 

Steps to Reproduce

See test projects

Did you find any workaround?

No

Relevant log output

No response

Activity

  1. added
    Area: App+Library Build
    needs-triage
    on Jan 15, 2023
  2. added
    Area: Bindings
    and removed
    Area: App+Library Build
    needs-triage
    on Jan 16, 2023
  3. jpobst commented on Jan 16, 2023

    @jpobst
    Contributor

    Looks like this can be fixed by ensuring the 2 versions of Kotlin match. Perhaps they moved these types from one package to another in 1.8, and if they are mismatched, it exists in both.

    <PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.0" />
  4. sk1llsh0t commented on Jan 16, 2023

    @sk1llsh0t

    I'm also experiencing these errors as well.

    If i add the package mentioned by jpobst to my xamarin android project, everything compiles fine.

  5. jpobst commented on Jan 16, 2023

    @jpobst
    Contributor

    @moljac We will probably need to do a full bump of the packages in AndroidX to fix this.

  6. moljac commented on Jan 16, 2023

    @moljac
    Contributor

    will do

  7. gmck commented on Jan 16, 2023

    @gmck
    Author

    @sk1llsh0t , @jpobst , @moljac
    I can also confirm your suggestion of adding <PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.0" /> also allowed both my test apps to build and run correctly.

  8. fgiacomelli commented on Jan 17, 2023

    @fgiacomelli

    Same problem for me, these errors:

    Error		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.		
    
    Error		kotlin.io.path.ExperimentalPathApi generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null		
    
    Error		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.		
    
    Error	       kotlin.io.path.FileVisitorBuilder generated by: Kotlin.IO.Path.IFileVisitorBuilder, Xamarin.Kotlin.StdLib.Jdk7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null		
    
    Error		kotlin.io.path.ExperimentalPathApi generated by: Kotlin.IO.Path.IExperimentalPathApi, Xamarin.Kotlin.StdLib.Jdk7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
    

    that appeared when I update Xamarin.AndroidX.AppCompat from 1.5.1.1 to 1.6.0 was solved adding the package as suggested above

  9. egorychev10 commented on Jan 18, 2023

    @egorychev10

    Thank you! That works for me

  10. jpobst commented on Jan 23, 2023

    @jpobst
    Contributor

    A full bump to all AndroidX NuGets/dependencies was published Jan 21. Updating to the latest versions should fix this and remove the need for the additional <PackageReference>.

  11. ghost locked as resolved and limited conversation to collaborators on Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: Bindings

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions