Error when using Abbyy RTR SDK sample

  • 657 Views
  • Last Post 26 September 2018
[REMOVED] posted this 01 February 2018

Hello,

I'm using Abbyy RTR SDK sample (https://github.com/abbyysdk/RTR-SDK.Cordova/tree/master/cordova-plugin-abbyy-rtr-sdk-sample)

I'm on a ionic3 cordova project with angular5.

I've just built the project with ionic helloworld and used ressources from Abbyy RTR SDK sample on github.

I was careful to follow the installation instructions and i think i made no mistake.

When i launch my app, i have the sample page but when i fire the "Text Capture" button i have this error :

Error loading ABBYY RTR SDK:

              java.lang.NullPointerException: Attempt to invoke virtual method 'void com.abbyy.mobile.rtr.cordova.RtrManager.initWithLicense()' on a null object reference

It's seems like RtrManager was never instantiated, but we told me that normaly i haven't to modifiy the Java source code and simple launch the sample.

Anyone has an idea ? I've have nearly not the more time to fix this for a client...

Available if needed more details

Thanks !

Order By: Standard | Newest | Votes
yannnike posted this 14 March 2018

 I have the same issue.

Did you solve the problem?

Oksana Serdyuk posted this 10 August 2018

Hello,

It seems that the issue was fixed some time ago. Could you please check the fix published on July 15 in GitHub: Fix Cordova-Android 7 Incompatibility?

Massimiliano Borgatti posted this 17 September 2018

I have the same issue and wasn't able to resolve with the fix reported above.

Do you have any update?

Marc Feliu posted this 19 September 2018

Hello, 

Same problem here. Does someone found a solution?

Thanks

Oksana Serdyuk posted this 20 September 2018

Officially we do not support the Ionic framework and we have never tested our mobile products with this development environment. However, the Cordova plugin together with the code sample have been updated up to the 1.0.6 version by our developers recently and the plugin includes some improvements. So, possibly you will be able to use them for your Ionic project. Please try and let us know about your result!

Marc Feliu posted this 20 September 2018

Hi Oksana,

Yesterday we tried with Cordova 8.0.8, IONIC 4.0.5 and the latest version but this couldn't work.

We got this error:

com.abbyy.mobile.rtr.cordova.RtrManager.initWithLicense()' on a null object reference

Thanks

Oksana Serdyuk posted this 26 September 2018

Hi Marc,

Thank you for your message, we received all details from you by email. At the moment this request is sent to our R&D Department for investigating and testing with Ionic. We will let you know about any news.

Oksana Serdyuk posted this 26 September 2018

Hi all,

Fortunately, our testing engineers have managed to run our Cordova plugin with the sample in Ionic. The reason of this issue is that in Cordova 7 under Android the OnCreate() function is not called in RtrManager and it is not initialized. The fix on Github is workable, but you need to make sure that all the files from this fix have replaced the old files in the plugin.

In general, you should follow the steps:
1. Make sure that the RTR SDK assets are in the right place.
2. Ensure that all files from the fix have replaced the original plugin files.
3. Verify that the correct path to the library is specified in the build.gradle file.
4. Build the project:

 cordova build android


Also it is necessary to make sure that in the project (not in the plugin, but exactly in the project), the new files are also "picked up" after building the project. To do this, go to \platforms\android\app\src\main\java\com\abbyy\mobile\rtr\cordova and check that all four files, namely:

  • RtrManager.java
  • RtrPlugin.java
  • activities\TextCaptureActivity.java
  • activities\DataCaptureActivity.java

are replaced with the files from the fix. It is necessary to pay your special attention to this moment.

After that, everything should work.

Close