Java Bindings - type System.Byte, base interface System.IComparable does not exist RRS feed

  • Question

  • User13420 posted


    I'm trying to bind a simple jar package I've made in Mono for Android but always getting this error.

    Warning 2 For type System.Byte, base interface System.IComparable`1 does not exist. D:\Projectos\samples\JavaBindingsMvvmCross\JavaBindingsMvvmCross.JBLibrary\BINDINGSGENERATOR JavaBindingsMvvmCross.JBLibrary

    Already try to add things in the metadata.xml file with no success.

    This is the Java Class I use to export the Jar package:

    package jb;

    public class JbHello { private String _msg;

    public JbHello() { _msg = "Hello from JAR"; }

    public String getMessage() { return _msg;

    public float getNumber() { return 22/7; //PI

    public static String getMessageStatic() { return "Hello from JAR static"; } }

    Does anyone knows how to bypass this warning?

    Thanks in advance

    Monday, June 3, 2013 5:48 PM

All replies

  • User1568 posted

    This question keeps popping up and I'm not sure that a real solution has been suggested yet.

    Could you attach the JAR here?

    Tuesday, June 4, 2013 2:34 AM
  • User13420 posted

    Here's the jar file. Its a simply one. I just wanted to bind something to test.

    Yes, that question seams to be arround but really didn't find any solution from the previous posts.

    Tuesday, June 4, 2013 8:46 AM
  • User1568 posted

    Thanks. I've used this to file a bug report, I hope that's ok.

    In the meantime you can probably just ignore this warning (it might be completely harmless?), unless you are seeing issues.

    Tuesday, June 4, 2013 12:14 PM
  • User13420 posted

    Nope, no problem, thanks for the bug report.

    The warning seams to be blocking because I can't seam to be able use the binding. Shouldn't I just get a namespace mapping the package? Something like jb.JbHello.getMessageStatic() in C# ?! Or am I obligated to create a wrapper mapping in the Metadata.xml?

    Tuesday, June 4, 2013 1:54 PM
  • User1568 posted

    It builds fine for me, and when referencing the binding project or dll I can access JB.JbHello just fine. Please note that capitalization and certain naming aspects might be different in the C# version - more 'Csharpish' if you will :)

    Tuesday, June 4, 2013 1:58 PM
  • User13420 posted

    Do you get any intellisense? I can create an instance of JB.JbHello object but can't manage to call the functions (getMessage or GetMessage etc.).

    The lack of intellisense on it is worring me.

    As your personal opinion what do you think about this binding projects? They seam to give too much trouble for its benefits.

    Tuesday, June 4, 2013 2:33 PM
  • User1568 posted

    The binding generator improves upon the Java code by wrapping getter and setter methods like getMessage in a C# property. So instead of making a call to GetMessage, you simply use the Message property.

    There is nothing wrong with binding projects in general - they are used all over the place. The ease of creating them could be certainly be better, and there might be the occassional bug, but nothing really blocking that I know of. It's pretty mature.

    Tuesday, June 4, 2013 2:56 PM
  • User1568 posted

    By the way, you should absolutely be seeing the Message and Number properties through intellisense, as well as the static JB.JbHello.MessageStatic property.

    If you're not, it seems like you have an installation issue, would be good to have some more detail on your configuration then.

    Tuesday, June 4, 2013 2:58 PM
  • User13420 posted

    Just notice the intellisense only works if I referenced the DLL file. If I reference the project it doesn't work. I was referencing the project that's why it didn't work. Is there any reason for that?

    Hmmm.. what kind of configuration detail to you need?

    Tuesday, June 4, 2013 3:35 PM
  • User1568 posted

    Strange. Are you on Xamarin Studio or VS? Which version?

    Tuesday, June 4, 2013 3:55 PM
  • User13420 posted

    Visual Studio 2012

    Tuesday, June 4, 2013 4:07 PM
  • User1568 posted

    Could you attach an example solution where this happens?

    Tuesday, June 4, 2013 6:44 PM
  • User13420 posted

    Sure, here it is.

    Its a sample using MvvmCross but tried also with a clean Android App project and when referencing the project I never got intellisense.

    Wednesday, June 5, 2013 10:28 AM
  • User1568 posted

    I opened your project, but intellisense on your binding works fine, both when referencing as a DLL and as a project directly.

    Are you using Resharper? Which version?

    Wednesday, June 5, 2013 7:01 PM
  • User13420 posted

    Quite strange. I don't use Reshsarper and have the Update 2 for Visual Studio 2012 Premium edition.

    Thursday, June 6, 2013 9:25 AM
  • User1568 posted

    Hmm.. sounds a bit like a Visual Studio bug then?

    I would be curious what happens when you do install Resharper (if you've never tried it or are still on the fence - go for it. It's one of the best things about developing with Visual Studio, gaving Resharper available). The reason why I say that is that Resharper actually changes how Intellisense works, which might explain why we're seeing different things.

    Thursday, June 6, 2013 11:25 PM