dlopen failed: library “libopencv_java4.so“ not found 解决

x33g5p2x  于2022-03-06 转载在 Java  
字(0.6k)|赞(0)|评价(0)|浏览(295)

dlopen failed: library "libopencv_java4.so" not found

Android studio编译yolov5时报错,

最后解决方法:

app所在目录的build.gradle修改:

指向opencv 的库arm64-v8a所在的父目录,报错就解决了。

externalNativeBuild {
        cmake {
            version "3.10.2"
            path file('src/main/jni/CMakeLists.txt')
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jni/opencv']  // libs
        }
    }

build.gradle完整代码:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.tencent.yolov5ncnn"
        archivesBaseName = "$applicationId"
        externalNativeBuild {
            cmake {
                cppFlags ""
//

相关文章

最新文章

更多