Cordova Android error

  • 109 Views
  • Last Post 04 October 2018
Goriandriza posted this 04 June 2018

I have an error when a try to open textcaptuting. The error says that “ Attempt to invoke virtual method 'void com.abbyy.mobile.rtr.cordova.RtrManager.initWithLicense()' on a null object reference”. I dont know why is this happening to me

Order By: Standard | Newest | Votes
Diana Khammatova posted this 05 June 2018

To investigate the issue deeper could you please provide us with some additional information:

1. What version of RTR SDK do you use: free or extended? If the second one, then kindly specify your serial number.

2. Could you specify whether we understood correctly that you are using
Cordova Plugin Example? Is your issue reproduced on it?

3. Could you please describe step-by-step how we can reproduce the error message on our side?

4. Please describe the issue in more details. You can attach some screenshots and logs for illustrating the problem.

You can send this information to SDK_Support@abbyy.com.

Marc Feliu posted this 21 September 2018

Hi Diana,

We send an email to support about this issue, answering this questions.

Thanks

Oksana Serdyuk posted this 04 October 2018

Hi all,

As we have already written in another similar post, 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