0

I am trying to create a Xamarin Android binding library which is referencing org.apache.xml.security.transforms , Org.Apache.Xml.Security.Algorithms

Which reference I have to add to make sure it is working fine?

Sample errors

1>BINDINGSGENERATOR : warning BG8900: Type org.apache.xml.security.transforms.Transforms: FxDG naming violation: Type name 'Transforms' matches namespace part 'Transforms'.

\obj\Debug\generated\src\Org.Apache.Xml.Security.Algorithms.Implementations.IntegrityHmac.cs(150,20,150,31): warning CS0108: 'IntegrityHmac.IntegrityHmacRIPEMD160.GetDHandler()' hides inherited member 'IntegrityHmac.GetDHandler()'. Use the new keyword if hiding was intended.

Pooran
  • 1,640
  • 2
  • 18
  • 25
  • 1
    Please attach a MVCE(http://stackoverflow.com/help/mcve) and any further information about this binding to the post such as the location of the library, the requirements page, and any other information you might have pertaining to the question. – Jon Douglas Sep 28 '16 at 14:58
  • Uploaded it.. thanks for pointing out – Pooran Sep 29 '16 at 20:03
  • 1
    These are just warnings it seems. The binding compiles just fine. Is there a class missing that you have noticed? You can alter the name of this type via `Metadata.xml` if you'd like: https://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb – Jon Douglas Sep 29 '16 at 20:11
  • Yes, it is missing CLServices. – Pooran Sep 30 '16 at 06:28
  • Can u help me with one sample that will allow access to CLServices? – Pooran Oct 02 '16 at 17:39
  • 1
    Can you be more specific? `CLServices` is being generated here: [DotPeek Example](http://content.screencast.com/users/JDouglas18/folders/Snagit/media/968328f6-4122-4a46-98a2-c4f958e79cd2/10.02.2016-13.19.png). – Jon Douglas Oct 02 '16 at 19:20
  • I am not seeing CLService. https://1drv.ms/i/s!AkQ9G9AdaYOPgacTfHROOl7-aZoB1A Is it possible to share the code ? – Pooran Oct 03 '16 at 06:06
  • 1
    I did not change any code, simply ran yours. Make sure your JDK is 1.8 and you aren't changing the compilation target. Finally change the jar to `EmbeddedJar` rather than `InputJar` – Jon Douglas Oct 03 '16 at 06:09
  • I am setting LibraryProjectZip to aar file and InputJar for jar file. Am I doing correct? – Pooran Oct 03 '16 at 06:10
  • Got it.. let me try it – Pooran Oct 03 '16 at 06:10
  • What to set for aar file? – Pooran Oct 03 '16 at 06:11
  • yes.. I am seeing it now . I will try calling the service in new android project and get back to you :) – Pooran Oct 03 '16 at 06:27
  • Got it to work .. Thanks @JonDouglas :) How to mark this question as answered? – Pooran Oct 03 '16 at 14:02
  • Also can you let me know when to use InputJar, LibraryProjectZip, EmbeddedJar options ? – Pooran Oct 03 '16 at 14:03
  • I will add an answer and you can update and mark as answered. – Jon Douglas Oct 03 '16 at 14:03

1 Answers1

1

These are not errors, but rather the binding generator giving you a couple of fair warnings.

1>BINDINGSGENERATOR : warning BG8900: Type org.apache.xml.security.transforms.Transforms: FxDG naming violation: Type name 'Transforms' matches namespace part 'Transforms'.

This is simply a warning telling you that the name Transforms matches part of the previous namespace org.apache.xml.security.transforms. Again this isn't a big issue unless these classes are not generating.

\obj\Debug\generated\src\Org.Apache.Xml.Security.Algorithms.Implementations.IntegrityHmac.cs(150,20,150,31): warning CS0108: 'IntegrityHmac.IntegrityHmacRIPEMD160.GetDHandler()' hides inherited member 'IntegrityHmac.GetDHandler()'. Use the new keyword if hiding was intended.

This warning is saying that the GetDHandler() implementation of IntegrityHmac.IntegrityHmacRIPEMD160 is being hidden. Typically this is an issue of obfuscation.

I do have a general binding guide that has most of these aspects covered once you know what you're looking for:

https://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb

However after looking over your source, it seems that everything compiles just fine. There are a few notes here:

  1. Ensure you are compiling with the correct JDK. I used JDK 1.8 in testing yours, but the documentation of the SDK you are binding to might use a different one.
  2. Make sure you are using the correct Build Action for your JARs. You can find a recommended use case in our documentation: https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/#Build_Actions (InputJar does not embed into the .dll and must be found at runtime. Thus you should use EmbeddedJar)
Jon Douglas
  • 13,006
  • 4
  • 38
  • 51