Forum Xamarin Xamarin.Android

How to fix error with JAR binding in Xamarin.Android

I have a Java JAR SDK I would like to bind in order to use with Xamarin.Android.

I have followed this guide in order to do so:
https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-a-jar/

The SDK I am trying to incorporate is:
https://www.magtek.com/Content/SoftwarePackages/99510109.zip

The error that is occurring states:
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'MTBaseService' does not exist in the namespace 'Com.Magtek.Mobile.Android.Mtlib' (are you missing an assembly reference?) BindingLibraryT3

How would I resolve this issue?

Best Answer

Answers

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Chances are, the type that it's looking for wasn't generated or was generated in a different namespace. A couple of things to double check:

    1) Did you ensure all reference libraries were added?

    2) Did you decompile the generated .dll to see if all types made it?

    Follow my guide here to help out in these areas:

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

  • philiphuynhphiliphuynh USMember ✭✭

    Thank you for your response Jon, I really appreciate your help.

    I am now trying to incorporate another SDK for Xamarin.Android.

    The error it is giving me is:
    Severity Code Description Project File Line Suppression State
    Error error: IPermissionListener has private access in UsbController
    com.idtechproducts.usbhid.sdk.UsbController.IPermissionListener Driver c:\users\philip.huynh\documents\visual studio 2015\Projects\IDTech_SDK\Driver\obj\Debug\android\src\mono\com\idtechproducts\usbhid\sdk\UsbController_IPermissionListenerImplementor.java 8

    Please advise on how to resolve this issue.

  • philiphuynhphiliphuynh USMember ✭✭

    Thank you so much for your help on this issue Jon! I was able to successfully bind a JAR file using your guide.

  • pepeluchepepeluche MXMember ✭✭

    @philiphuynh how did you resolve the issue? : PermissionListener has private access in UsbController
    i still having this issue and cannot run my android project because this error

Sign In or Register to comment.