Ctypes error on Kodi for Android
#1
Hi all,

I am developing an addon that use ctypes to call to my c++ library. It works correctly with Kodi 16 for Windows or MacOS, but when I tried with Kodi for Android, it throws permission error when loading the library file.

I put my library file in my addon's folder.

Do you have this problem before?

PS: for Android, I use *.so file as library. Is it correct?
Reply
#2
Working with binary libs in Kodi for Android is seriously fubar, so there is no guarantee that it will even work. Some recommendations:
- Your lib's name must start with "lib", for example libfoo.so.
- Usually, Kodi temp directory is a good place for binary libs. For some reasons they are loaded from that directory more often than not. However, there is no guarantee.

And it goes without saying that your lib must be built with the correct NDK toolchain.
Reply
#3
@Roman_V_M:
Thank you very much for your answer.

I used Android NDK to build my library and copy the libfoo.so for the correct arch of my phone.
I tried with both main addon folder and the data folder but it didn't work. Do you mean "temp" folder is the data folder or another one?

And about the prefix "lib" of the so file, let me try to call the method to load without lib (similar to System.loadLibrary)
Reply
#4
(2016-04-07, 17:59)anphunl Wrote: Do you mean "temp" folder is the data folder or another one?

I mean special://temp directory: http://kodi.wiki/view/Special_protocol
Reply

Logout Mark Read Team Forum Stats Members Help
Ctypes error on Kodi for Android0