Skip to content Skip to sidebar Skip to footer

How To Fix Gradle Task ':app:mergeDebugJniLibFolders' In Flutter Gradle Build For Opencv Native With NDK?

I'm setting up a new flutter app and I want to add opencv native (c++) plugin using NDK. I've installed and configured OpenCV and NDK (using differents tutorials) and I got this er

Solution 1:

I found a solution !

I get in my build.gradle those lines:

sourceSets {
    main {
        jniLibs.srcDirs = ['src/main/libs']
        java.srcDirs = ['src']
        ...
    }
 }

So I decided to open the src/main/libs file which contain only

../../../../OpenCV-Andoid-sdk/native/libs/

... a wrong path that should be :

../../../../sdk/native/libs/

I put the corect path into the gradle file respecting the new relative path :

sourceSets {
    main {
        jniLibs.srcDirs = ['../../sdk/native/libs/']
        java.srcDirs = ['src']
        ...
    }
 }

And now it compile perfectly ! What a tricky error on which I spend 6 evenings...


Post a Comment for "How To Fix Gradle Task ':app:mergeDebugJniLibFolders' In Flutter Gradle Build For Opencv Native With NDK?"