Search code examples
androidandroid-activityandroid-library.so

java.lang.UnsatisfiedLinkError error in android


I am making an app for QR code scanner. Got a sample from google where everyone commented it works. I am getting the following error

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/app.iihr-2/base.apk"],nativeLibraryDirectories=[/data/app/app.iihr-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libiconv.so"

I am getting the error in this line

  static {
    System.loadLibrary("iconv");
  }

the libiconv.so file is present in \libs\armeabi-v7a

as well as in

libs\armeabi

Can anyone help me?


Solution

  • I fixed the error by adding more folders in jniLibs.

    I added in the following fashion

    Image

    Then I put my .so files in all of them. Still error was coming, so I changed my target sdk from 23 to 22 and it worked.