Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV Android - Cannot Resolve Corresponding JNI Function

Hi, I'm trying to setup Android Studio with Opencv by following this tutorial outlined here: https://www.youtube.com/watch?v=OTw_GIQNbD8

I can get the result obtained by the person giving the tutorial but upon trying to actually use some of Opencv's functions I run into some trouble.

I am able to load the Opencv library but upon trying use some of the native functions such as "Imgcodecs.imread" I get the error: ".lang.UnsatisfiedLinkError: No implementation found for long org.opencv.imgcodecs.Imgcodecs.imread_1(java.lang.String)"

I believe I have tracked down the issue to the following:

image description

It seems that Android Studio is unable to detect the native C++ code which I'm guessing should be picked up from jiniLibs folder I now have in app/src/main?

I've tried updating Android Studio to the latest stable build and I have fixed my file paths for my android SDK and NDK as having white-space can apparently affect the running of native code. The issue still persists.

I have been trying to fix this for the last 4 hours, any help would be greatly appreciated!