0

I am trying to integrate the SightCall Android SDK in my Xamarin app. Since the SDK contains a jar and .so file I need to bind it as a Java Binding Library as then add it as a Reference in my project. I followed the steps of creating a Java Binding project given in the Xamarin website but after building I'm getting 12 errors and many warnings. The 12 errors are below:

C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(8,8): Error CS0019: Operator '!=' cannot be applied to operands of type 'Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.Type' and 'System.Type' (CS0019) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(7,7): Error CS1502: The best overloaded method match for 'Android.Runtime.JNIEnv.StartCreateInstance(System.IntPtr, System.IntPtr, params Android.Runtime.JValue[])' has some invalid arguments (CS1502) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(59,59): Error CS1503: Argument 1: cannot convert from 'Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.Type' to 'System.IntPtr' (CS1503) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(71,71): Error CS1503: Argument 2: cannot convert from 'string' to 'System.IntPtr' (CS1503) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(9,9): Error CS0019: Operator '==' cannot be applied to operands of type 'Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.Type' and 'System.Type' (CS0019) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(9,9): Error CS0019: Operator '==' cannot be applied to operands of type 'Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.Type' and 'System.Type' (CS0019) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.cs(8,8): Error CS0019: Operator '==' cannot be applied to operands of type 'Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.Type' and 'System.Type' (CS0019) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.cs(8,8): Error CS0019: Operator '!=' cannot be applied to operands of type 'Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.Type' and 'System.Type' (CS0019) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.cs(7,7): Error CS1502: The best overloaded method match for 'Android.Runtime.JNIEnv.StartCreateInstance(System.IntPtr, System.IntPtr, params Android.Runtime.JValue[])' has some invalid arguments (CS1502) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.cs(59,59): Error CS1503: Argument 1: cannot convert from 'Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.Type' to 'System.IntPtr' (CS1503) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.cs(71,71): Error CS1503: Argument 2: cannot convert from 'string' to 'System.IntPtr' (CS1503) (SightCallBindingLibrary)
C:\Users\user\Documents\Projects\SightCallBindingLibrary\SightCallBindingLibrary\obj\Debug\generated\src\Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.cs(8,8): Error CS0019: Operator '==' cannot be applied to operands of type 'Net.Rtccloud.Sdk.Event.Meetingpoint.StatusEvent.Type' and 'System.Type' (CS0019) (SightCallBindingLibrary)

Could you please let me know how can I fix the above issues?

Edit

<metadata>
    <!--
  This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
  <remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />

  This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
  <remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
  -->
<!--   <remove-node path="/api/package[@name='Net.Rtccloud.Sdk.Event.Meetingpoint']/class[@name='RequestEvent.Type']" />-->
<!--    <remove-node path="/api/package[@name='Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent']"/>-->
 <!--   <remove-node path="/api/package[@name='Net.Rtccloud.Sdk.Event.Meetingpoint.MeetingPointEvent']/class[@name='RequestEvent.Type']"/>-->


</metadata>

I have commented out the various ways in which I tried as I get a warning that the removed node path matched no nodes.

Ingrid Cooper
  • 1,191
  • 3
  • 16
  • 27
  • Hi, can you please provide the complete build trace (with the lower verbosity level)? As well as the generated files `RequestEvent.cs` and `StatusEvent.cs` – Simon Marquis Aug 20 '15 at 08:11
  • The binding file would also be great – Simon Marquis Aug 20 '15 at 08:33
  • Hi @SimonMarquis, Sure I can provide you with the complete build trace and the RequestEvent.cs and StatusEvent.cs but since I cannot upload those files here can you please let me know in which other way can I share them with you? Also could you please let me know what is the binding file that you require? – Ingrid Cooper Aug 20 '15 at 10:07
  • I'm not familiar enough with xamarin, but it seems to be related to a mis-configuration of a binding file. Maybe this link can help you http://iswwwup.com/t/3f9e3d2bc16d/c-porting-achartengine-to-xamarin.html – Simon Marquis Aug 20 '15 at 10:11
  • Yes I have seen that link and similar links and tried similar ways by modifying in the Metadata.xml file but it doesn't seem to work. I have pasted my Metadata.xml file in my Edit. Please check. – Ingrid Cooper Aug 20 '15 at 10:23
  • It seems that somehow the `Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent.Type` innerclass is not correctly taken into account and conflicts with `System.Type` – Simon Marquis Aug 20 '15 at 11:36
  • 1
    You should use java package conventions (lowercase: net.rtccloud.sdk.event.meetingpoint.RequestEvent). Check this out https://stackoverflow.com/questions/31450487/binding-project-inconsistent-accessibility-on-inner-classes-but-cant-get-transf#comment50869898_31450487 – Simon Marquis Aug 21 '15 at 08:57
  • Thank you for your suggestion. I tried that and it worked. – Ingrid Cooper Aug 21 '15 at 14:08

1 Answers1

1

As described here, bindings should respect the java package naming convention (lowercased).

Here, it should be :

net.rtccloud.sdk.event.meetingpoint.RequestEvent
instead of
Net.Rtccloud.Sdk.Event.Meetingpoint.RequestEvent

Simon Marquis
  • 7,248
  • 1
  • 28
  • 43