-
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.util.find_library 64-bit error #2468
Comments
macdems
added a commit
to macdems/python-for-android
that referenced
this issue
Jul 8, 2021
macdems
added a commit
to macdems/python-for-android
that referenced
this issue
Jul 8, 2021
macdems
added a commit
to macdems/philipstv-kivy-remote
that referenced
this issue
Jul 8, 2021
The fork is required until kivy/python-for-android#2468 is fixed.
Thanks for the detailed description and the fix ❤️ |
AndreMiras
added a commit
that referenced
this issue
Jul 25, 2021
Fix bad library found by ctypes for 64-bit arch (#2468)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was trying to use
zeroconf
package for my application. It worked perfectly onarmeabi-v7a
, however the program crashed on launch onarm64-v8a
(both tested on Huawei P30).I have investigated the issues and discovered that the problem is with
ctypes.util.find_library
or, more precisely with the p4a moduleandoroid._ctypes_library_finder
in the functionfind_library
.The actual problem is that this function finds 32bit libraries regardless of the actual architecture. For example
returns
/system/lib/libc.so
both for 32- and 64-bit architecture. The correct behavior is to return this if Python is compiled for 32-bit and/system/lib64/libc.so
for 64-bit one.Below is the code of a simple Kivy app that shows the issue:
When compiled for
armeabi-v7a
it shows:while on
arm64-v8a
:The expected output is:
The source of this problem is in the line 47 of the file pythonforandroid/recipes/android/src/android/_ctypes_library_finder.py. For 64-bit Python (build target arch matters, not the system archiecture), the libraries to search should be
["/system/lib64/libc.so", "/system/lib/libc.so"]
.I am also submitting a pull request resolving this issue.
The text was updated successfully, but these errors were encountered: