Ionic 3 Could not find :abbyy-rtr-sdk-1.0

  • 323 Views
  • Last Post 14 November 2018
mr bemox posted this 13 November 2018

hello there, 

am working on a app and i liked the idea of abbyy live ocr, am using ionic 3 with cordova 8 , and android 7

 

i apply the new changes in the pull request in the github page it was mentioned in a previous answer, but nothing worked i followed the step all of it nothing work

 

it says Could not find :abbyy-rtr-sdk-1.0

the logs : when using cordova build android

 

Android Studio project detected

ANDROID_HOME=C:\Users\BeMoX\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\java\jdk1.8.0_181

studio

Subproject Path: CordovaLib

Subproject Path: app

publishNonDefault is deprecated and has no effect anymore. All variants are now published.

Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

        at build_3pvjd9u4o7277e5ewbq4j1cgq.run(G:\autoCR\platforms\android\app\build.gradle:147)

:CordovaLib:preBuild UP-TO-DATE

:CordovaLib:preDebugBuild UP-TO-DATE

:CordovaLib:compileDebugAidl UP-TO-DATE

:CordovaLib:compileDebugRenderscript UP-TO-DATE

:CordovaLib:checkDebugManifest UP-TO-DATE

:CordovaLib:generateDebugBuildConfig UP-TO-DATE

:CordovaLib:prepareLintJar UP-TO-DATE

:CordovaLib:generateDebugResValues UP-TO-DATE

:CordovaLib:generateDebugResources UP-TO-DATE

:CordovaLib:packageDebugResources UP-TO-DATE

:CordovaLib:platformAttrExtractor UP-TO-DATE

:CordovaLib:processDebugManifest UP-TO-DATE

:CordovaLib:processDebugResources UP-TO-DATE

:CordovaLib:generateDebugSources UP-TO-DATE

:CordovaLib:javaPreCompileDebug UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE

:CordovaLib:processDebugJavaRes NO-SOURCE

:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE

:app:preBuild UP-TO-DATE

:app:preDebugBuild

FAILURE: FAILED

Build failed with an exception.

 

* What went wrong:

Could not resolve all files for configuration ':app:debugCompileClasspath'.

> Could not find :abbyy-rtr-sdk-1.0:.

  Searched in the following locations:

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/google/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/google/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/android/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/android/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      https://jcenter.bintray.com//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      https://jcenter.bintray.com//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      https://dl.google.com/dl/android/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      https://dl.google.com/dl/android/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      file:/G:/autoCR/platforms/libs/android/abbyy-rtr-sdk-1.0-.aar

      file:/G:/autoCR/platforms/libs/android/abbyy-rtr-sdk-1.0.aar

      https://repo1.maven.org/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      https://repo1.maven.org/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

  Required by:

      project :app

 

* Try:

14 actionable tasks: 1 executed, 13 up-to-date

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 

* Get more help at https://help.gradle.org

 

BUILD FAILED in 12s

(node:15336) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:

FAILURE: Build failed with an exception.

 

* What went wrong:

Could not resolve all files for configuration ':app:debugCompileClasspath'.

> Could not find :abbyy-rtr-sdk-1.0:.

  Searched in the following locations:

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/google/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/google/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/android/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      file:/C:/Users/BeMoX/AppData/Local/Android/Sdk/extras/android/m2repository//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      https://jcenter.bintray.com//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      https://jcenter.bintray.com//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      https://dl.google.com/dl/android/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      https://dl.google.com/dl/android/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

      file:/G:/autoCR/platforms/libs/android/abbyy-rtr-sdk-1.0-.aar

      file:/G:/autoCR/platforms/libs/android/abbyy-rtr-sdk-1.0.aar

      https://repo1.maven.org/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.pom

      https://repo1.maven.org/maven2//abbyy-rtr-sdk-1.0//abbyy-rtr-sdk-1.0-.aar

  Required by:

      project :app

 

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 

* Get more help at https://help.gradle.org

 

BUILD FAILED in 12s

    at ChildProcess.whenDone (G:\autoCR\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)

    at emitTwo (events.js:126:13)

    at ChildProcess.emit (events.js:214:7)

    at maybeClose (internal/child_process.js:915:16)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

(node:15336) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:15336) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

 

 

 

Any help is appreciated :) 

 

Paridhi Pathak posted this 14 November 2018

Hey, I had the same issue ad resolved it just now by following below steps:

1. remove android platform and cordova-plugin-abbyy-rtr-sdk plugin

2. First install android platform and then Copy RTR SDK patterns and dictionaries and License file (`AbbyyRtrSdk.license`) to `www/rtr_assets`

3. Also copy RTR SDK patterns and dictionaries and License file (`AbbyyRtrSdk.license`) to platforms/android/app/src/main/assets

4. Add 'abbyy-rtr-sdk-1.0' in platforms/android/app/src/main/libs/android

5. In build.gradle add the below code: 

allprojects {

    repositories {

        flatDir {

                dirs '../android/app/src/main/libs/android'

            }

    }

  6. Now install the plugin cordova-plugin-abbyy-rtr-sdk and replace plugins/cordova-plugin-abbyy-rtr-sdk/scripts/android_move_assets.js code with the following code:

module.exports = function(ctx) {

if (ctx.opts.platforms.indexOf('android') < 0) {

         return;     

}

var fs = ctx.requireCordovaModule('fs'),

rimraf = ctx.requireCordovaModule('rimraf'),

         path = ctx.requireCordovaModule('path');

 

       var assetsPath = 'platforms/android/app/src/main/assets/'; // cordova-android >= 7

 

       return fs.stat(path.join(ctx.opts.projectRoot, assetsPath), function(error) {

         if (error) {

             assetsPath = 'platforms/android/assets/'; // cordova-android < 7

         }

 

           var src = path.join(ctx.opts.projectRoot, assetsPath, '/www/rtr_assets/');

           var dst = path.join(ctx.opts.projectRoot, assetsPath);

 

 

           var callback = function(message) {

             if (message) {

                 console.log('assets error' + message);

             }

         };

 

           rimraf.sync(path.join(dst, '!(www)*'));

           fs.readdirSync(src).forEach(function(file, index) {

             if (fs.lstatSync(path.join(src, file)).isDirectory()) {

                 fs.rename(path.join(src, file), path.join(dst, file.toLowerCase()), callback);

             } else {

                 fs.rename(path.join(src, file), path.join(dst, file), callback);

             }

         });

     });

 };

7. run command ionic cordova build android if successful test it on your device.  

Though i was able to run the project but i get the below error when i try to read text from image:   

Unspecified error while loading the engine. See logcat for details.

 

Hope this helps. If you get the same error after successfully building the app and find any resolution do share.   Thanks in advance    

Close