Compile Error trying to bind a ABBYY RTR SDK.AAR file via Xamarin Android Binding project

pingpong.6106pingpong.6106 USMember ✭✭
edited October 2018 in Xamarin.Android

I get the error below when I try to bind the "abbyy-rtr-sdk-1.0.aar" downloaded from https://rtrsdk.com/#RTR.Android.Online using Xamarin Android Binding project in Visual Studio 2017, by following the link https://docs.microsoft.com/en-gb/xamarin/android/platform/binding-java-library/binding-an-aar

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0234    The type or namespace name 'IRecognitionContextHolder' does not exist in the namespace 'Com.Abbyy.Mobile.Ocr4' (are you missing an assembly reference?)    AbbyLib    C:\_MyLab\Xamarin\My\OCR\TextRecogniser\AbbyLib\obj\Debug\generated\src\Com.Abbyy.Mobile.Ocr4.IRecognitionManager.cs    481    Active

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0738    'IDataCaptureServiceInvoker' does not implement interface member 'IRecognitionService.ExtendedSettings'. 'IDataCaptureServiceInvoker.ExtendedSettings' cannot implement 'IRecognitionService.ExtendedSettings' because it does not have the matching return type of 'IRecognitionServiceExtendedSettings'.    AbbyLib    C:\_MyLab\Xamarin\My\OCR\TextRecogniser\AbbyLib\obj\Debug\generated\src\Com.Abbyy.Mobile.Rtr.IDataCaptureService.cs    679    Active

Error    CS0738    'ITextCaptureServiceInvoker' does not implement interface member 'IRecognitionService.ExtendedSettings'. 'ITextCaptureServiceInvoker.ExtendedSettings' cannot implement 'IRecognitionService.ExtendedSettings' because it does not have the matching return type of 'IRecognitionServiceExtendedSettings'.    AbbyLib    C:\_MyLab\Xamarin\My\OCR\TextRecogniser\AbbyLib\obj\Debug\generated\src\Com.Abbyy.Mobile.Rtr.ITextCaptureService.cs    681    Active

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    I have created a new project and tested the abbyy-rtr-sdk-1.0.aar according to the link you provided step by step, but there is no error.

    Could you please post the steps of reproducing the problem? (eg: Which steps)

    Besides. you can check the following link which explains how to resolve binding problems by modifying this metadata.: https://docs.microsoft.com/en-gb/xamarin/android/platform/binding-java-library/customizing-bindings/java-bindings-metadata

  • pingpong.6106pingpong.6106 USMember ✭✭
    edited October 2018

    @jezh,

    Below is my steps (the "abbyy-rtr-sdk-1.0.aar" downloaded from https://rtrsdk.com/#RTR.Android.Online using Xamarin Android Binding project in Visual Studio 2017, by following the link https://docs.microsoft.com/en-gb/xamarin/android/platform/binding-java-library/binding-an-aar)

    1 Add "abbyy-rtr-sdk-1.0.aar" under Jars folder
    2 Set Build Action to LibraryProjectZip
    3 Set Compile Using Android version: to Android 4.4 (KitKat) for the Binding project
    4 Build the project

    I get the errors above.

    What verion of Java are you using? Are you sure if works for you?

    I cannot see any help from this link https://docs.microsoft.com/en-gb/xamarin/android/platform/binding-java-library/troubleshooting-bindings

    Below is the versions of IDE:
    Window 7

    Microsoft Visual Studio Enterprise 2017 (2)
    Version 15.8.6
    VisualStudio.15.Release/15.8.6+28010.2041
    Microsoft .NET Framework
    Version 4.7.03062

    Xamarin 4.11.0.776
    Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

    Xamarin Designer 4.15.9
    Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    Xamarin Templates 1.1.116
    Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

    Xamarin.Android SDK 9.0.0.19
    Xamarin.Android Reference Assemblies and MSBuild support.

    Xamarin.iOS and Xamarin.Mac SDK 12.0.0.15
    Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

  • AhmedRadwanAhmedRadwan SAUniversity ✭✭

    I am getting a similar error when trying to bind abbyy-mi-sdk-2.0.aar, following the same steps that @pingpong.6106 mentioned.

    Error CS0738: 'IImageCaptureServiceInvoker' does not implement interface member 'IRecognitionService.ExtendedSettings'. 'IImageCaptureServiceInvoker.ExtendedSettings' cannot implement 'IRecognitionService.ExtendedSettings' because it does not have the matching return type of 'IRecognitionServiceExtendedSettings'. (CS0738)

  • AhmedRadwanAhmedRadwan SAUniversity ✭✭
    edited January 2019

    In my case I've added the following line inside Metadata.xml file to solve the issue:

    <metadata>
    <attr path="/api/package[@name='com.abbyy.mobile.rtr']/interface[@name='IImageCaptureService']/method[@name='getExtendedSettings']" name="managedReturn">Com.Abbyy.Mobile.Rtr.IRecognitionServiceExtendedSettings</attr>
    </metadata>
    
Sign In or Register to comment.