Xamarin.Jetbrains.Annotations
namespace clash with JetBrains.Annotations
causes CS0433 build failure
#885
Labels
wontfix
This will not be worked on
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
MSBuild version 17.9.8+b34f75857 for .NET 8.0.204
Description
First noticed in ppy/osu@9c22fa3.
The java binding for
org.jetbrains.annotations
(named Xamarin.Jetbrains.Annotations) uses theJetbrains.Annotations
namespace. This directly clashes with the .NET JetBrains.Annotations which also uses theJetbrains.Annotations
namespace.This namespace clash is apparent when using a type that is defined in both the Java and in the .NET version of the library. For example,
NotNullAttribute
.Offending line that produces the clashing namespace:
https://github.com/xamarin/AndroidX/blob/3c8325e40f151719f5d3e5a3c34baa56b0b88bb5/Directory.Build.props#L74
As for fixing this issue, I suggest you change the namespace for the java binding. I don't think the types from the java library are meant to be used in application code, so the name of the namespace probably doesn't matter.
Steps to Reproduce
JetBrains.Annotations.NotNullAttribute
Did you find any workaround?
Add this to the project. Taken from https://stackoverflow.com/questions/9194495/type-exists-in-2-assemblies/65127159#65127159.
Relevant log output
The text was updated successfully, but these errors were encountered: