Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

和OpenCV的版本不兼容 #32

Open
brandlee opened this issue Nov 7, 2023 · 9 comments
Open

和OpenCV的版本不兼容 #32

brandlee opened this issue Nov 7, 2023 · 9 comments

Comments

@brandlee
Copy link

brandlee commented Nov 7, 2023

之前我集成过OpenCV的库,在集成paddleocr4android的时候,出现了下面的报错:
`2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:

  • /Users/lee/.gradle/caches/transforms-3/66b319963f01fd390fd0dcf81960c5a1/transformed/jetified-fastdeplyocr-1.2.8/jni/arm64-v8a/libc++_shared.so
  • /Users/lee/.gradle/caches/transforms-3/1e39377269f3187c28605b26bd78a7ad/transformed/jetified-Tiny-OpenCV-4.4.0-4/jni/arm64-v8a/libc++_shared.so
    If you are using jniLibs and CMake IMPORTED targets, see`
    能麻烦看看,有什么好的解决方案么?
image
@brandlee
Copy link
Author

brandlee commented Nov 7, 2023

我使用的库是这个:https://github.com/zynkware/Tiny-OpenCV

@equationl
Copy link
Owner

android {
    packagingOptions {
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
    }
}

指定一下你要用的 so 文件

@brandlee
Copy link
Author

brandlee commented Nov 7, 2023

这样会直接导致之前使用openCV的库直接崩溃
image
image

@brandlee
Copy link
Author

brandlee commented Nov 7, 2023

这个能帮忙看看怎么解决么?搞了好几天,找不到很好的解决办法,您看看能和上面那个库保持一致的openCV版本么?

@equationl
Copy link
Owner

你改成指定使用你用的另外一个库的 so 文件试试

@brandlee
Copy link
Author

brandlee commented Nov 9, 2023

@equationl 这个应该怎么指定呢?求教,只知道使用pickFirst,但是不知道怎么指定使用另一个库的so文件...
我引入的是这个库:implementation 'com.github.zynkware:Tiny-OpenCV:4.4.0-4'
https://github.com/zynkware/Tiny-OpenCV

@equationl
Copy link
Owner

参考这个:https://stackoverflow.com/questions/75015347/use-different-versions-of-so-files-in-different-modules-in-android-like-libc

删除这个库或者 opencv 其中一个的 so 文件,错误原因应该是 libc++_shared 版本冲突导致的,你试一下使用哪个版本能同时兼容两个库,如果都不行的话,估计只能你自己 clone 其中一个库的源码,把 ndk 版本修改为和另外一个库一致

@brandlee
Copy link
Author

brandlee commented Nov 9, 2023

好的👌🏻我来试试,感谢回答

@Woo-wdy
Copy link

Woo-wdy commented Sep 6, 2024

RV3$Z0RK(W7~}4Q@(36P8

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

No branches or pull requests

3 participants