Service code failed to import jnius (dlopen error) but app/main.py succeeded to import jnius

34 views
Skip to first unread message

Haotian Deng

unread,
Sep 23, 2017, 6:35:28 PM9/23/17
to Python For Android
Hi there,

I am using p4a master branch to build my app using SDL2 bootstrap.
I succeeded to import jnius in app/main.py, but when I start service using android.AndroidService, import jnius generate such error:
    ImportError: dlopen failed: file offset for the library "/data/user/0/net.mobileinsight.app/files/app/lib/python2.7/site-packages/jnius/jnius.so" >= file size: 0 >= 0

I don't understand why import jnius in app/main.py succeeded while it failed in app/service/main.py.

Thanks advance for any help!


Message has been deleted

Haotian Deng

unread,
Sep 23, 2017, 7:47:15 PM9/23/17
to Python For Android
I am not sure if it is the cause, it seens like org.kivy.android.PythonService doesn't include "ANDROID_UNPACK" (PythonActivity does), and that is required by Python/dynload_shlib.c to load libpymodules.so

Haotian Deng

unread,
Sep 23, 2017, 8:00:46 PM9/23/17
to Python For Android
I find that in previous p4a implementation, the environment string being used is "ANDROID_PRIVATE" and it is included in both PythonService and PythonActivity, I wonder if such modification is intended for some reason?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages