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

ASFASF USMember

Hello,

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<System.Byte> 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

Posts

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

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

    Could you attach the JAR here?

  • ASFASF USMember

    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.

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    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.

  • ASFASF USMember

    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?

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    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 :)

  • ASFASF USMember

    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.

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    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.

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    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.

  • ASFASF USMember

    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?

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

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

  • ASFASF USMember

    Visual Studio 2012

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Could you attach an example solution where this happens?

  • ASFASF USMember

    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.

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    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?

  • ASFASF USMember

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

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    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.

Sign In or Register to comment.