python-for-android
python-for-android copied to clipboard
Issue with Android example
The example in examples/android/takepicture Has some issues with PIL
- The way this recipe ise set up kivy is the only requirement and thus PIL isnt built/ installed
03-18 00:11:22.875: I/python(5530): File "/home/anant/projects/kivy/examples/android/takepicture/.buildozer/android/app/main.py", line 32, in <module>
- If I add pillow as a requirement I get an error saying
03-17 23:46:50.810: I/python(5430): File "/home/anant/projects/kivy/examples/android/takepicture/.buildozer/android/app/_applibs/PIL/Image.py", line 66, in <module>
03-17 23:46:50.820: I/python(5430): ImportError: dlopen failed: "/data/data/org.test.takepicture/files/_applibs/PIL/_imaging.so" is 64-bit instead of 32-bit
I know python-for-android has a recipe for PIL using the original PIL but I am unsure how to triger that through buildozer.
@anantasty have you tried adding pil to the application requirements line in the buildozer.spec file? Line 36 if no edits have been made.
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy,pil
Pip fails to install it instead of installing the recipe
On Tue, Mar 29, 2016, 16:56 Drew A. [email protected] wrote:
@anantasty https://github.com/anantasty have you tried adding pil to the application requirements line in the buildozer.spec file? Line 36 if no edits have been made.
(list) Application requirements
comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy,pil
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/4095#issuecomment-203162055
Alright, making sure I understand the problem. The app builds properly but when run on the android device it crashes with the second error from your original comment?
If I add pillow as a requirement I get an error saying
03-17 23:46:50.810: I/python(5430): File "/home/anant/projects/kivy/examples/android/takepicture/.buildozer/android/app/_applibs/PIL/Image.py", line 66, in <module> 03-17 23:46:50.820: I/python(5430): ImportError: dlopen failed: "/data/data/org.test.takepicture/files/_applibs/PIL/_imaging.so" is 64-bit instead of 32-bit
Yes that is absolutely true. It does not look live pil gets installed since the example doesn't have it in buildspec. Adding pillow installs the 64 bit libs since I am on a 64 bit machine. Adding pil in the build spec doesn't build. Since pil isn't on pip any more. For some reason it tries to install pil from pip and not the recipe.
On Wed, Mar 30, 2016, 10:13 Drew A. [email protected] wrote:
Alright, making sure I understand the problem. The app builds properly but when run on the android device it crashes with the second error from your original comment?
If I add pillow as a requirement I get an error saying
03-17 23:46:50.810: I/python(5430): File "/home/anant/projects/kivy/examples/android/takepicture/.buildozer/android/app/_applibs/PIL/Image.py", line 66, in
03-17 23:46:50.820: I/python(5430): ImportError: dlopen failed: "/data/data/org.test.takepicture/files/_applibs/PIL/_imaging.so" is 64-bit instead of 32-bit — You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/4095#issuecomment-203533853
Starting to run out of ideas on this one. Because for some reason it builds fine with pil
as a requirement for me. Could you toss a verbose buildozer log from when you have pil as a requirement into a gist and share the link?
Sure I'll do that. Thanks a lot
On Thu, Mar 31, 2016, 12:14 Drew A. [email protected] wrote:
Starting to run out of ideas on this one. Because for some reason it builds fine with pil as a requirement for me. Could you toss a verbose buildozer log from when you have pil as a requirement into a gist and share the link?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/4095#issuecomment-204061238
Hey there!
We're automatically closing this issue since the original poster (or another commenter) hasn't yet responded to the question or request made to them 14 days ago. We therefore assume that the user has lost interest or resolved the problem on their own. Closed issues that remain inactive for a long period may get automatically locked.
Don't worry though; if this is in error, let us know with a comment and we'll be happy to reopen the issue.
Thanks!
(Please note that this is an automated comment.)
I would appreciate that you re-open this issue. The way forward was to use pygame instead of PIL to resize images, however this is not satisfactory solution.
Have pil in my spec file, did "from PIL import Image" on my py file, and still get the error: (buildozer 0.33 with Python3)
Traceback (most recent call last):
File "/home/suporte/Desktop/Mobile/Vistorias/.buildozer/android/app/main.py", line 84, in
@inclement that's the reason I need pillow so badly hahaha
Hey guys.. I have the same issue when try to use opencv in android application.. Here is the error message logged to android adb logcat:
ImportError: dlopen failed: "/data/data/org.test.myapp/files/app/lib/python2.7/site-packages/cv2/cv2.so" is 64-bit instead of 32-bit
If anyone knows how to fix this error please comment below..
I have the exact same problem here. And I have to specify that I was correctly working few days ago (I used it for only for generating image file, and it worked as intended).
I have "pillow" in my requirement, logs said it was installed via pip. But now it won't work.
my logcat display:
I/python (10432): Traceback (most recent call last):
I/python (10432): File "/home/mathias/Stage/DepoGit/Pygmacontroller/V1.2/.buildozer/android/app/main.py", line 29, in <module>
I/python (10432): File "/home/mathias/Stage/DepoGit/Pygmacontroller/V1.2/.buildozer/android/app/matrixconfiguration.py", line 20, in <module>
I/python (10432): File "/home/mathias/Stage/DepoGit/Pygmacontroller/V1.2/.buildozer/android/platform/build/dists/operatorshift/private/lib/python2.7/site-packages/PIL/Image.py", line 56, in <module>
I/python (10432): ImportError: dlopen failed: "/data/data/com.pygmatec.operatorshift/files/app/lib/python2.7/site-packages/PIL/_imaging.so" not 32-bit: 2
I/python (10432): Python for android ended.
Would be nice to have the issue marked as Open again, since the problem still exists for multiple users and crashes the apps
You should NOT put pillow
in your requirements since it does not (yet) have a recipe, see #786.
If you use pillow
in your requirements you will get the "not 32-bit" error.
Hi @VajiraPrabuddhaka I got the same issue when I tried to put opencv as requirement in the buildozer.spec. Did you manage to fix this on your own ?
ImportError: dlopen failed: "/data/data/org.test.test_apk/files/app/crystax_python/site-packages/cv2/cv2.so" is 64-bit instead of 32-bit
@NicoLivesey am also running on same issue... you found a fix?
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.
That doesn't seem like very good bot behaviour.
i have the same problem i can't create any file on the device. Wen i try the app crash
Bump. Please resolve this
@anyone is this resolved? w.r.t. original issue with Pillow it gets imported with import PIL but is installed with pip install Pillow. The latter format is what should be dropped into buildspec reqs
But I get same "is 64-bit instead of 32-bit" error with opencv, same as multiple users above.
Am I to understand this error as apk installing 64 bit during build, but Android requiring 32-bit when deployed?
Wait guys the pillow recipe should be working to me
https://github.com/kivy/python-for-android/blob/0.7.0/pythonforandroid/recipes/Pillow/init.py
I've been using it for https://github.com/kivy-garden/garden.zbarcam and it's working OK.
@xavier-gutierrez could you please share your buildozer.spec file.
Also to be sure I would use Pillow
note the capital P
, because I can't remember if p4a is case insensitive, but the recipe definitely has an upper case.
Please try again with a clean build, but this definitely works for me also in https://github.com/AndreMiras/QrScan / https://play.google.com/store/apps/details?id=com.github.andremiras.qrscan
Apologies, lost the actual file due to cloning error on my VM -- but I'm 100% sure the requirements line was as follows
requirements = python, kivy, Pillow
I've switched to opencv for my image processing task, but I'm getting the same 64-bit error. Now my requirements line is
requirements = python3, kivy, opencv-python
Does this bypass the kivy recipe and installs PyPi opencv instead?
PS -- since I'm on a VM, maybe specifying a 32-bit machine will compile openCV appropriately for android mobile. I'll let you know how it goes
looks like the p4a recipe already builds for 32 buit, I just had to specify that instead of the PyPi download
requirements = python3, kivy, opencv
Solution: in windows operating system install pillow madule from comand prompt:
python -m pip install pillow
Same here I/python: ImportError: dlopen failed: "/data/user/0/org.test.myapp/files/app/_python_bundle/site-packages/cv2/cv2.so" is 64-bit instead of 32-bit any solution for cv2.so?
+1 I/python:ImportError: dlopen failed: "/data/user/0/****/files/app/_python_bundle/site-packages/cv2/cv2.so" is 64-bit instead of 32-bit
Same here but with opencv, if someone has a fix would be nice to know.
ImportError: dlopen failed: "/data/user/0/org.test.tennistrainingsystem/files/app/_python_bundle/site-packages/cv2/cv2.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
Did you find a solution to this @mabrao ?