native-opencv-android-template icon indicating copy to clipboard operation
native-opencv-android-template copied to clipboard

couldn't find "libnative-lib.so"

Open notchdesign opened this issue 4 years ago • 2 comments

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.

notchdesign avatar Dec 16 '20 07:12 notchdesign

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.

julian59189 avatar Feb 02 '21 19:02 julian59189

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")

nqa112 avatar Apr 21 '22 09:04 nqa112

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")

yes.Its working

PrincessGitu avatar Sep 21 '23 11:09 PrincessGitu