-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ctypes.py and _ctypes.so are not available #333
Comments
@olymk2 Great progress on your fork, i'm waiting your PR :) |
i am hoping to put one in soon using this PR olymk2#1 it seems to build the ctypes.so file and place it in ../libs/armeabi/_ctypes.so as i expect how ever running on an android tablet i am still getting. .buildozer/android/app/_applibs/freetype/init.py", line 19, in when i try to use a library that requires ctypes in this case freetype i still get so i am not sure if there is something else i need todo after the .so file exists i have put in the PythonService.java file to load the library. does anyone have any ideas ? i could put it in for a pr now because it does build the .so file. |
the libs in libs are more "system" lib, not python extension. Either the _ctypes.so is biglinked with libpython.so, or it's separated in the ctypes/_ctypes.so directory, same on desktop. |
okay, i will try again later see if i can figure out if its creating a folder for ctypes or if its being biglinked. its quite difficult to spot whats going on as the build process chucks out so much content. thanks for the tip |
Created a dead basic repo to test python imports, link here if its usefull to any one https://github.com/olymk2/buildozer-test-imports |
just an update with progress i can see ctypes is created and placed in the path below. /opt/buildozer/testappimports/.buildozer/android/platform/python-for-android/dist/testappimports/private/lib/python2.7/lib-dynload/_ctypes.so _ctypes.so is 168.1 kB in /testappimports/private/lib/python2.7/lib-dynload/_ctypes.so but still no joy, i did manage to patch out all errors i could see during the build process i am wondering if i have something else going wrong some where |
Okay this may actually be working i just built my test project wondering if i have some cruft left on my system perhaps the clean is not fully clearing everything away. going to blow away the build on my main program later and see if it works anyone fancy trying the above to see if it works, if you use the test project be aware it builds the project in /opt/buildozer so change or take that out of the spec file. |
Hi, I tried this and it worked! I applied the patch from: All compiled well, and it's working on Android. |
@GeoRW I have a PR in for these changes, you will find that although it compiles you can not import any libraries because ctypes does not know where to look. There is a simple fix for that also in this branch #343 if you have tested from this branch may be worth commenting hopefully we can get it merged :) |
well, I can use the compiled library in Android without any issues. no need to patch util.py in my case. I'm loading libwebp.so when using https://github.com/expobrain/python-webm which requires ctypes. Don't know much about C and the whole build process, but happy to make this working for my project. Cheers. |
ok, tried the patches at #343 on clean environment and all workes fine without a need to patch malloc.h in NDK. ctypes library is compiled and packaged correctly. Cheers |
Ctypes is now part of python-for-android! |
Hello all, I tried to compile with buildozer and python-2.7.2 is downloaded. I tried to follow the solution provided here but I found the recipe is different. After finish build, _ctypes still doesn't appear in the folder. My environment is MacOS 10.13.4. Hope someone can help. Thanks. |
Seems quite a few libraries require _ctypes.so to be available i have found a few reported by others and in my case freetype requires it.
seems there are reports of people getting it to work (I have not managed myself yet) here are some links i have found.
Patch here
https://groups.google.com/forum/?hl=en#!searchin/python-android/ctypes/python-android/vDaaJXNYz_A/eazMVI-DQSYJ
related issue here
#301
and another attempt here
https://bitbucket.org/Nodrev/kivy-python-for-android-with-ctypes/commits/30948f20cef489dba165b3b33aefccbb5f400b84#chg-recipes/python/recipe.sh
I have been trying myself but i dont seem to get a ctypes.so file created, my attempt is here but i am unsure about what i am doing :p
https://github.com/olymk2/python-for-android/tree/feature/ctypes
Would be good to see this one patch an dbuilding.
The text was updated successfully, but these errors were encountered: