Android Studio 3.5 + OpenCV 4.1

asked 2019-08-26 04:18:21 -0600

I see OpenCV Manager is no longer on play store, and I found a post that mentioned you have to statically link the OpenCV library. I have tried a dozen different tutorials and I still can't get this to work.

I selected native C++ application and added this to CMakeList.txt

include_directories(/home/grom/OpenCV-android-sdk/sdk/native/jni/include)
add_library( lib_opencv SHARED IMPORTED )
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java3.so)

The article also says to add

cppFlags "-frtti -fexceptions"
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'

But this gives me errors. Is there any guides that are up to date ?

edit retag flag offensive close merge delete

Comments

Hi, past the error message, I will try help you.

First of all why libopencv_java3.so and not libopencv_java4.so?

eagle77 gravatar imageeagle77 ( 2019-08-27 17:10:22 -0600 )edit