native-opencv-android-template
native-opencv-android-template copied to clipboard
couldn't find "libnative-lib.so"
I am trying to implement openCV 4.4.0 in my android application but it's not working. Open CV is installed successfully and I am getting success log on create while calling OpenCVLoader.initDebug(); but I am getting error on calling System.loadLibrary("native-lib"); This what is the error message: 2020-12-16 12:22:27.774 19087-19087/com.learn.opencvapplication E/AndroidRuntime: FATAL EXCEPTION: main Process: com.learn.opencvapplication, PID: 19087 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.learn.opencvapplication-2SgMMN8HNLPD9LVjRA9Xiw==/base.apk"],nativeLibraryDirectories=[/data/app/com.learn.opencvapplication-2SgMMN8HNLPD9LVjRA9Xiw==/lib/arm64, /data/app/com.learn.opencvapplication-2SgMMN8HNLPD9LVjRA9Xiw==/base.apk!/lib/arm64-v8a, /system/lib64]]] couldn't find "libnative-lib.so" Previously I have used CV3 and it was working fine, CV 4 has this issue and I need CV 4.
In my experience it is most likely because some part of the project still points to CV3 somewhere.
Make sure you clean the project to not have any stale paths to CV 3. Worst case you can always try to clone the project to another location and then point it to CV4 and see if it persists.
Change native-lib to <your project name>. For example, my project is demo ( project name can be found at MainActivity.kt -> package com.example.demo ), so it is System.loadLibrary("demo")
Change
native-libto<your project name>. For example, my project isdemo( project name can be found at MainActivity.kt -> package com.example.demo ), so it isSystem.loadLibrary("demo")
yes.Its working