Duplicate dependancies causes an Ambiguous reference compilation error? #442
-
A college an myself are attempting to convert an old project that compiled Apache Calcite and a few other libraries using an older version of IKVM to the latest version of IKVM. I'm not sure if we have run into a bug or if we are missing a property setting in our project. However, when we compile the project we end up with the following error: error CS0433: The type 'Range' exists in both 'com.google.common, Version=31.1.0.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58' and 'io.grpc, Version=1.9.0.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58' [/dev/calcite-ikvm/CalciteIKVM/CalciteIKVM/CalciteIKVM.csproj] Here the example project I'm using to duplicate the error we get on the larger project:
We are testing on an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
That's a CSharp error, not an IKVM error. Your references compiled fine. There are however types with the same name in both assemblies. Chances are the are types with the same name in both original JARs. Why? I do not know. Check, though. |
Beta Was this translation helpful? Give feedback.
Well, the issue can bepresent, in that you have duplicate overlapping class names on your classpath in Java, and if you attempted to compile code against both of these JAR files at the same time, javac.exe would throw an error regarding the duplicate class name. When you type new Range in Java, it wouldn't know which Range you were talking about.
So here's what I've found: https://github.com/ClickHouse/clickhouse-java/tree/main/third-party-libraries/io.grpc
There's a package
com.clickhouse:io.grpc
in Maven, dependended on by the clickhouse stuff. It appears to be a repackage of gRPC, but configured differently (with JPMS support). So yeah, it overlaps. Which one do you intend to use?In J…