Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

More than one file was found with OS independent path 'lib/armeabi-v7a/libcardioDecider.so #186

Closed
lantian699 opened this issue Mar 21, 2017 · 10 comments

Comments

@lantian699
Copy link

lantian699 commented Mar 21, 2017

General information

  • SDK/Library version: 5.5.1
  • Android Version and Device: Samsung S5 with Android 6.0

Issue description

I had this error when running app in Android Studio, complile is pass. I can't understand why this error appears. And I found nothing in Internet for the similar error when using card.io. perhaps this is particular for my project due to different dependencies I used.

image

@lantian699
Copy link
Author

no one answer my question, I finally found that it is due to incompatibilities with Reach5 library.

@lkorth
Copy link
Member

lkorth commented Apr 11, 2017

Would you mind sharing the incompatibilities you ran into for anyone else that may run into this issue?

@lkorth lkorth closed this as completed Apr 11, 2017
@lantian699
Copy link
Author

lantian699 commented Apr 11, 2017

I don't have further information for this issue, I just test every library listed in my gradle file to verify which one can cause the conflict with card.io. finally that is reachFive (https://reachfive.co/en/) which we use to connect our app with social account. I'm working on it and i will go back here to post my solution if I could try to figure out.

@lantian699
Copy link
Author

lantian699 commented Apr 14, 2017

Since two weeks I'm stuck in it, finally I figure out the source of problem.
It is because that ReachFive Library (a library used in my project)has include an old version of CARD.IO for his PAYPAL service. So I found the exactly same .so file in his AAR. and my solution is brutal, I use winRAR to open directly its AAR library and delete JNI file completely for 2 reason below:

  1. The application needs just one set of .so file (needed for Card.IO) in JNI path, if two libraries contain the same .so files, it will create conflict obviously.
  2. We dont use the PAYPAL service provided in ReachFive Library. And even though we need it, I think its old Card.IO can also use this new version .so file, it depends on the compatibility I dont verify this point.

I have another solution which can simply eliminate this kind of error in order to build successfully the project. add this in gradle file:

packagingOptions { exclude "lib/armeabi-v7a/libcardioDecider.so" exclude "lib/armeabi-v7a/libcardioRecognizer.so" exclude "lib/armeabi-v7a/libopencv_imgproc.so" exclude "lib/armeabi-v7a/libcardioRecognizer_tegra2.so" exclude "lib/armeabi-v7a/libopencv_core.so" exclude "lib/armeabi/libcardioDecider.so" exclude "lib/mips/libcardioDecider.so" exclude "lib/x86/libcardioDecider.so" }

But this solution is not perfect, it will exclude all .so file mentioned above. then neither ReachFive nor Card.IO can access into his so file, Card.IO will not start camera. I wonder that why in this method "packagingOptions" I cannot define a scope that my rules will applied for?

Alright, at least it works !

@AndroPlus
Copy link

This one also will help.. https://stackoverflow.com/a/44962630/1237175

@chavantr
Copy link

check with your lib folder might be having same aar/jar file in double in with different name.

@zakreya
Copy link

zakreya commented May 7, 2018

Error:Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.

More than one file was found with OS independent path 'lib/armeabi-v7a/libopencv_java3.so'
i want delete this path becuse conflict with file orginal
im use code in gredl
packagingOptions{
exclude 'lib/armeabi-v7a/libopencv_java3.so'

}

but not success ...
plz help me

@Saturdaycong
Copy link

I have a similar problem, read your issue, I have solved my problem. thank you

@pkjvit
Copy link

pkjvit commented Oct 6, 2018

I have got the same issue file lib/x86_64/libsqlcipher.so found more thane once and found out the solution.
This happens due to the same file coming multiple times in dependencies or modules.

Fixed by adding following code in app build.gradle file inside android block

android {
   ---
   packagingOptions {
        pickFirst 'lib/x86_64/libsqlcipher.so'
        pickFirst 'lib/armeabi/libsqlcipher.so'
        pickFirst 'lib/x86/libsqlcipher.so'
        pickFirst 'lib/armeabi-v7a/libsqlcipher.so'
        pickFirst 'lib/arm64-v8a/libsqlcipher.so'
    }
   ---
}



@iadcg
Copy link

iadcg commented Jan 4, 2019

@pkjvit Thanks mate. it worked! =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants