Error After Including A 2nd Jni Library To My Android Project (opencv)
Solution 1:
The error means that the file libuvcNative.so has not been installed with your APK. This can happen for a wild variety of root causes.
Your case is exactly same as described here. The QihanOpenSDK_1.1.8.0.aar only has an armeabi version of libuvcNative.so. The fix is to change line #15 of build.gradle to read
abiFilters 'armeabi'
But I must confess that your CMakeLists.txt puzzled me. For me,
set_target_properties(lib_qihan PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR} /libs/QihanOpenSDK_1.1.8.0.aar)
does not work. To be sincere,
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR} /libs/${ANDROID_ABI}/libopencv_java3.so)
also does not match my books. For the latter, I believe that you simply added a space while copy/pasting the script.
For the former, I know a special trick to have an so file from an imported aar used in native build.
I believe that your working version not only discards all OpenCV libraries, but also does not build the libnative-lib.so. This way, cmake does never look for libuvcNative.so, but still this native lib is deployed with the APK because the aar is a compiled dependency of your app. I guess that some of the QihanOpenSDK classes explicitly calls
System.loadLibrary("uvcNative")
If your libnative-lib.so does not use external symbols from libuvcNative.so, you don't need the trick I mentioned above and don't need to mention the QihanOpenSDK at all in your CMakeLists.txt.
Post a Comment for "Error After Including A 2nd Jni Library To My Android Project (opencv)"