CodyF CodyF - 5 months ago 36
Android Question

Bytedeco's Tesseract library was added through gradle dependency, but not found

In my project, several bytedeco javaCV libraries were pulled in through a gradle dependency:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.bytedeco:javacv:1.2'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.1.0-1.2', classifier: 'windows-x86_64'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.0.2-1.2', classifier: 'windows-x86_64'
compile group: 'org.bytedeco.javacpp-presets', name: 'tesseract', version: '3.04.01-1.2', classifier: 'windows-x86_64'
compile group: 'org.bytedeco.javacpp-presets', name: 'leptonica', version: '1.73-1.2', classifier: 'windows-x86_64'
}


The application compiles, and all of the libraries are present under my 'External Libraries':
enter image description here

For some reason, I can access all of the namespaces for the imported bytedeco projects EXCEPT for the Tesseract.

enter image description here

Any help would be greatly appreciated! bytedeco-tesseract

Answer

It appears that when you add the dependencies on one of the org.bytedeco.javacpp-preset modules you need to add two dependencies. One for the platdorm specific dlls and one classifier-less dependency for the java/jni files.

      repositories {
        mavenCentral()
      }
      dependencies {
        compile group: 'org.bytedeco.javacpp-presets', name: moduleName,
                   version: moduleVersion + '-1.2'
        compile group: 'org.bytedeco.javacpp-presets', name: moduleName,
                   version: moduleVersion + '-1.2', classifier: platformName
      }