Start a new topic
Solved

How to start create binding in Xamarin for android ?

Hi I am trying to use Wikitude AAR files in Xamarin....I am trying to create DLL to use in the project...I am having some issue in building it


Com.Wikitude.Tracker.IObjectTrackerListener.cs(47,47): Error CS0102: The type 'TargetsLoadedEventArgs' already contains a definition for 'p0' (CS0102) (AarBinding)


Com.Wikitude.Tracker.IObjectTrackerListener.cs(14,14): Error CS0102: The type 'ErrorLoadingTargetsEventArgs' already contains a definition for 'P1' (CS0102) (AarBinding)


Hello Pritam,

Please provide further details on the issue:
  • Which version of the SDK are you using?
  • What device does this happen with (os Version and model)?

Thanks

Eva

Hi Thank you for your reply....


I am using  Google Pixel XL API version 26 Android 8.0...But my target is set to Android 6.0


I am using wikitude SDK 6.0.1 native AAR file


I have changed the  Metadata.xml to this still have the same problem...


 <attr path="/api/package[@name='com.wikitude.tracker']/class[@name='ErrorLoadingTargetsEventArgs']/parameter[@name='p0']" name="managedName">p01</attr>




Hi Peter,


please note that we do not officially support using Native SDK with Xamarin. 


The interface InstantTrackerScenePickingCallback was deprecated and moved into the InstantTracker interface. Maybe this is causing your issue.

With the SDK 8.0 Beta this deprecated interface was removed, which should solve this issue. 


Best Regards,

Alex

With the latest version of the SDK (7.2.1) I get the following errors when trying to accomplish the above:


 

Error	CS0529	Inherited interface 'IInstantTrackerScenePickingCallback' causes a cycle in the interface hierarchy of 'IInstantTrackerScenePickingCallback'		\src\Com.Wikitude.Tracker.IInstantTracker.cs


Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called 'Validate' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called 'OnCompletion' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called 'n_OnCompletion_ZLcom_wikitude_common_util_Vector3_' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called 'GetOnCompletion_ZLcom_wikitude_common_util_Vector3_Handler' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called 'GetObject' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called 'Dispose' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0111	Type 'IInstantTrackerScenePickingCallbackInvoker' already defines a member called '.ctor' with the same parameter types		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0101	The namespace 'Com.Wikitude.Tracker' already contains a definition for 'IInstantTrackerScenePickingCallbackInvoker'		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0579	Duplicate 'Register' attribute		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	
Error	CS0579	Duplicate 'global::Android.Runtime.Register' attribute		\src\Com.Wikitude.Tracker.IInstantTrackerScenePickingCallback.cs	

 




With the following XML file:

 

<metadata>

    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onTargetsLoaded']/parameter[1]" name="managedName">tracker</attr>

    <attr path="/api/package[@name='com.wikitude.tracker']/
        interface[@name='ObjectTrackerListener']/method[@name='onTargetsLoaded']"
        name="argsType">ObjectTrackerListenerTargetsLoadedEventArgs</attr>
    
    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[1]" name="managedName">tracker</attr>

    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[2]" name="managedName">errorCode</attr>

    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[3]" name="managedName">errorMessage</attr>


    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='InstantTrackerListener']/method[@name='onError']/parameter[1]" name="managedName">tracker</attr>

    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='InstantTrackerListener']/method[@name='onError']/parameter[2]" name="managedName">errorCode</attr>

    <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='InstantTrackerListener']/method[@name='onError']/parameter[3]" name="managedName">errorMessage</attr>
</metadata>

 


Hi Pritam,


please try the following:

 

<attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onTargetsLoaded']/parameter[1]" name="managedName">tracker</attr>	

 

If this solves your first error you should be able to apply the same to the other interfaces.


Please note that we do not officially support the Wikitude Native SDK on Xamarin.


Best Regards,

Alex

Hi Thanks for your reply...


I know..Actually I have some requirements where I will scan image in low resolution and capture it in high resolution I think the cross platform is not working fine for this....


I have achieved this functionality using the native ios SDK....want to try native one here...Dont you think it will be good idea ?


Thanks,


Pritam


Hi Thank you very much...


I am able to resolve few issue...But I am stuck at one more place


now I have three parameters as p0,p1 and p2 How I can change them....


 <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[1]" name="managedName">tracker</attr> 


 <attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[1]/parameter[2]" name="managedName">int</attr> 

Hi,


please try the following:

  

<attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[1]" name="managedName">tracker</attr>

<attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[2]" name="managedName">errorCode</attr>	

<attr path="/api/package[@name='com.wikitude.tracker']/interface[@name='ObjectTrackerListener']/method[@name='onErrorLoadingTargets']/parameter[3]" name="managedName">errorMessage</attr>	

  

Best Regards,

Alex

Hi,


Thank you very much Great :)


It is working :)


thanks again for your help.


Best regards,


Pritam

Hi I tried to specify this in  MetaData.xml like this


<?xml version="1.0" encoding="UTF-8"?>
<metadata>
 <attr path="/api/package[@name='Com.Wikitude.Tracker.IObjectTrackerListener']/class[@name='TargetsLoadedEventArgs']/field[@name='p0']" name="managedName">P0</attr>

</metadata>


But it is not working any help on this appreciate

Login or Signup to post a comment