How to resolve errors caused by a jar file imported in Android binding project

JJ Muller 0 Reputation points
2024-08-23T09:30:33.0966667+00:00

Hi,

I have a existing jar file imported in my Xamarin Forms android project that communicates to a specific device. A new jar file has been supplied with new features to control/access the device, however I get some errors when I import the new jar file that I do not understand.

Once the binding project in built, it produces .cs files with the below errors.

I get this in Xamarin and in .Net Maui. This same jar file can be used in a java android application (Android Studio) and works fine.

SeverityCodeDescriptionFileSeverityCodeDescriptionFileErrorCS0260Missing partial modifier on declaration of type 'EMVHandler'; another partial declaration of this type exists\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Emv.IEMVHandler.csErrorCS0579Duplicate 'Register' attribute\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Emv.IEMVHandler.csErrorCS0102The type 'OpenFailEventArgs' already contains a definition for 'p0'\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Fingerprint.IFingerDeviceOpenListener.csErrorCS0102The type 'OpenFailEventArgs' already contains a definition for 'P0'\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Fingerprint.IFingerDeviceOpenListener.csErrorCS0102The type 'OpenSuccessEventArgs' already contains a definition for 'p0'\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Fingerprint.IFingerDeviceOpenListener.csErrorCS0102The type 'OpenSuccessEventArgs' already contains a definition for 'P0'\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Fingerprint.IFingerDeviceOpenListener.csErrorCS0111Type 'OpenFailEventArgs' already defines a member called 'OpenFailEventArgs' with the same parameter types\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Fingerprint.IFingerDeviceOpenListener.csErrorCS0102The type 'FailureEventArgs' already contains a definition for 'p0'\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Net.Wifi.ICredentialListener.csErrorCS0102The type 'FailureEventArgs' already contains a definition for 'P0'\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Net.Wifi.ICredentialListener.csErrorCS0111Type 'FailureEventArgs' already defines a member called 'FailureEventArgs' with the same parameter types\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Net.Wifi.ICredentialListener.csErrorCS0260Missing partial modifier on declaration of type 'QPbocHandler'; another partial declaration of this type exists\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Qpboc.IQPbocHandler.csErrorCS0579Duplicate 'global::Android.Runtime.Register' attribute\NewPosTechBinding\obj\Debug\net8.0-android\generated\src\Com.Pos.Device.Qpboc.QPbocHandler.cs

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,912 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,587 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.