dlopen failed to load 32 bit instead of 64 bit library

回眸只為那壹抹淺笑 提交于 2019-12-12 01:07:54

问题


I have developed an application which uses 32 bit library libmylibrary.so but when I use system.loadLibrary("mylibrary"), it says that cannot find library in /system/lib64 or /vendor/lib64. I don't see my library in /data/app-lib .. etc. My Android version is 5.1.1. I even copied my library in /system/lib64 but it is still giving error message that dlopen failed to load 32 bit instaed of 64 bit. Please provide some valuable suggestions.


回答1:


it says that cannot find library in /system/lib64

IF the application is looking for libraries in lib64, there is a high chance that the application is a 64-bit app. If so, it will never load 32-bit library, no matter how hard you try.

On Linux, you can check whether the app is 64-bit by starting it, and then doing cat /proc/$pid/maps




回答2:


Thanks Employed Russian , I did a mistake . I added my native library in libs folder of my application.But didn't added it to build path dependencies and libraries in my android studio.After i added it to build path ,i am able to see my 32 bit library in /data/data/app-name/libs folder.Since i am using only one 32 bit library it got loaded and working fine.



来源:https://stackoverflow.com/questions/38056720/dlopen-failed-to-load-32-bit-instead-of-64-bit-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!