Unable to dlopen(libsomething.so) Cannot load library: link_image[1995]: failed to link libsomething.so

后端 未结 4 1133
日久生厌
日久生厌 2020-12-16 14:28

I am writing an android project which has Native layer helping the java layer, and am stuck at a place where when i try to do a System.loadLibrary, it is throwing error that

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-16 15:05

    First find the location of the .so file. and then can try:

    Following example assumes the location of shared library as: /data/data/my.package/lib/libmysharedlibrary.so

    try {
        //System.loadLibrary("mysharedlibrary");
        System.load("/data/data/my.package/lib/libmysharedlibrary.so");
    } catch (UnsatisfiedLinkError use) {
        Log.e("JNI", "WARNING: Could not load libmysharedlibrary.so");
    }
    

提交回复
热议问题