问题
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