Skip to content Skip to sidebar Skip to footer

Gradle Can't Find Opencv Libraries For Debugging With Ndk

I've been developing Android apps with C++ code by just executing ndk-build. I've always used OpenCV, so in my Android.mk there was: include $(CLEAR_VARS) OPENCV_LIB_TYPE:=SHARED

Solution 1:

You need ldLibs and ldFlags to specify link libraries. With exeprimental plugin, I use the following fragment:

def appAbi = "armeabi-v7a"
def OpenCV_sdk = "~/opencv/sdk"
…
model { android.ndk {
…
    ldFlags += "-L$OpenCV_sdk/native/libs/$appAbi".toString()
    ldFlags += "-L$OpenCV_sdk/native/3rdparty/libs/$appAbi".toString()
    ldLibs += ['opencv_imgproc', 'opencv_core', 'opencv_hal', 'tbb']
} }

Post a Comment for "Gradle Can't Find Opencv Libraries For Debugging With Ndk"