I'm trying to use javacv for android in a OCR Application example from RM Theis Tesseract project.
For this I've put the gradle dependences with the another project example of javacv android. Follows bellow the gradle file that I made:
//-----------------------------------------------------------------------------------------------
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "edu.sfsu.cs.orange.ocr"
minSdkVersion 9
targetSdkVersion 10
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
compile 'com.rmtheis:tess-two:6.0.4'
compile files('libs/google-api-translate-java-0.98-mod2.jar')
compile files('libs/json_simple-1.1.jar')
compile files('libs/jtar-1.0.4.jar')
compile files('libs/microsoft-translator-java-api-0.6-mod.jar')
//------------- I've put this part to include javacv in the project:
compile group: 'org.bytedeco', name: 'javacv', version: '1.3.2'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.2.0-1.3', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.2.0-1.3', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-x86'
}
I can sync gradle and not become no errors. But if I start to run the app, it shows me these errors:
Error:Execution failed for task ':OCRTest:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties
File1: C:\Users\andre.menegussi\.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\opencv\3.2.0-1.3\2a562ef4d4408c1dea5d4190b6bbd151a83c8eae\opencv-3.2.0-1.3-android-x86.jar
File2: C:\Users\andre.menegussi\.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\opencv\3.2.0-1.3\d442ea90d190e680d8c6f18469aaeaed26c00c77\opencv-3.2.0-1.3.jar
File3: C:\Users\andre.menegussi\.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\opencv\3.2.0-1.3\8affe9427828689dd9b5cc8d59d8492cf28bd06f\opencv-3.2.0-1.3-android-arm.jar
These javacv parte I got from the javacv android example. And the javacv android example runs fine.
Can Anyone help me clarify what I need to do? I searched on web but the possible solutions didnt work for me.