Android Question Failed to load OpenCV's so file

xulihang

Active Member
Licensed User
Longtime User
I am trying to include opencv (https://repo1.maven.org/maven2/org/opencv/opencv/4.9.0/opencv-4.9.0.aar) in my project with the following code:
B4X:
#AdditionalJar: opencv-4.9.0.aar
Dim system As JavaObject
system.InitializeStatic("java.lang.System")
system.RunMethod("loadLibrary",Array("opencv_java4"))

But I meet the following error:

Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libopencv_java4.so" not found


What is the correct way to do this? I can load the library using a native android project using System.loadLibaray("opencv_java4") but not with B4A.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

xulihang

Active Member
Licensed User
Longtime User
opencv_java and NOT opencv_java4!



What is the reason to use another name?
The correct text is opencv_java4. I misspelled it the post.
 
Upvote 0

xulihang

Active Member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…