android can't load library when lib project has both armeabi and armeabi-v7a directory in libs directory

StackOverflow https://stackoverflow.com/questions/18245655

  •  24-06-2022
  •  | 
  •  

Question

I has an android project that depends on a lib project. And the lib project has an "armeabi" and "armeabi-v7a" directory in the "libs" directory, and both of them have a .so file inside. And my own project has only a armeabi directory in libs directory with a .so file inside.

Then I found when I run my project on a "armeabi-v7a" device it will crash. It says can't load library in the log. It seems that the app try to load the .so from "armeabi-v7a" directory but it dosen't have. Then I created an "armeabi-v7a" directory in libs directory in my own project and copied the .so file to the new directory and the app will be ok.

But it will increase the size of the apk package, is there any way to let the app load the .so file in the "armeabi" directory? Or can I delete the "armeabi-v7a" directory in the lib project? It seems to be ok...

Was it helpful?

Solution

If you need to support both armeabi and armeabi-v7a then just delete the armeabi-v7a lib from the library project.

But if it's okay to drop armeabi support, then delete the armeabi lib from the library project and, in your main project, move the armeabi lib into a new armeabi-v7a folder. Note: if you do this then make a note of this unconfirmed bug report.

You can read more about this in my answer here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top