1

OpenCV error from imported project. How can i resolve the following error, I m unable to resolve for past 2 days and searched lot regarding . I used to import this project (Project)and getting error. **

[2016-05-30 16:36:44 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/opencv/calib3d/Calib3d; [2016-05-30 16:36:44 - SplashActivity] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/opencv/calib3d/Calib3d;

**

I have tried removing and adding the library file. and clean build , eclipse restart and so on. nothing solves here.

when i run it shows this first and the above: Android Launch: Your project contains error(s), please fix them before running application. In Android Stuido:

Error:Execution failed for task ':java:packageAllDebugClassesForMultiDex'.

java.util.zip.ZipException: duplicate entry: org/opencv/calib3d/Calib3d.class

Update:

apply plugin: 'com.android.application' android { compileSdkVersion 15 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.fingerprintrecognition" minSdkVersion 15 targetSdkVersion 15 ndk { moduleName "nonfree_prebuilt" } } configurations { all*.exclude group: 'com.android.support', module: 'support-v4' } sourceSets.main { jni.srcDirs = [] } defaultConfig { multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile project(':openCVLibrary2411') compile files('libs/opencv-2.4.9-5.jar') } 

Thanks.

6
  • Can you please show us your build.gradle file? Commented May 30, 2016 at 12:03
  • @ishmaelMakitla kindly see my build.gradle file Commented May 30, 2016 at 12:05
  • Try setting multiDexEnabled false - also move your dependencies to the app-level build.gradle file. By the way, can you show the app-level gradle file as well? Commented May 30, 2016 at 12:14
  • can u elaborate this refers - dependencies to the app-level build.gradle file ? @ishmaelMakitla this above gradle file is app/gradle file Commented May 30, 2016 at 12:17
  • OK, noted. I suspect the issue might be that you are importing the same library opencv in two places - for instance if the libs folder is part of your project - this might confuse things as to which lib/jar to look at. Did you perhaps add the opencv-2.4.9-5.jar through the "configure buildpath" route? Commented May 30, 2016 at 12:26

1 Answer 1

1

This often happens when you import one library/jar multiple times. Please make sure you are not importing the opencv-2.4.9-5.jar from multiple places. It might also happen that one of the other libraries also imports this library - so you need to check that as well.

Have a look at a closely related issue and the selected answer here.

Hope this helps you resolve the issue.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.