Skip to content
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

Issue with Android example #1816

Open
AtlasPilotPuppy opened this issue Mar 18, 2016 · 30 comments
Open

Issue with Android example #1816

AtlasPilotPuppy opened this issue Mar 18, 2016 · 30 comments

Comments

@AtlasPilotPuppy
Copy link

The example in examples/android/takepicture
Has some issues with PIL

  1. 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>
  1. 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.

@Loran425
Copy link

@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 

@AtlasPilotPuppy
Copy link
Author

Pip fails to install it instead of installing the recipe

On Tue, Mar 29, 2016, 16:56 Drew A. notifications@github.com 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

@Loran425
Copy link

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

@AtlasPilotPuppy
Copy link
Author

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. notifications@github.com 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

@Loran425
Copy link

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?

@AtlasPilotPuppy
Copy link
Author

Sure I'll do that. Thanks a lot

On Thu, Mar 31, 2016, 12:14 Drew A. notifications@github.com 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

@kivybot
Copy link

kivybot commented Dec 25, 2016

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.)

@kivybot kivybot closed this as completed Dec 25, 2016
@alrea333
Copy link

alrea333 commented May 9, 2017

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.

@dfrison01
Copy link

dfrison01 commented Jul 26, 2017

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
File "/home/suporte/Desktop/Mobile/Vistorias/.buildozer/android/platform/build/dists/frvistorias/private/lib/python2.7/site-packages/PIL/Image.py", line 56, in
ImportError: dlopen failed: "/data/data/ind.frtech.car.frvistorias/files/app/lib/python2.7/site-packages/PIL/_imaging.so" is 64-bit instead of 32-bit

@inclement that's the reason I need pillow so badly hahaha

@VajiraPrabuddhaka
Copy link

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..

@matEhickey
Copy link

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.

@dfrison01
Copy link

Would be nice to have the issue marked as Open again, since the problem still exists for multiple users and crashes the apps

@AndreMiras
Copy link
Member

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.

@NicoLivesey
Copy link

NicoLivesey commented Feb 15, 2018

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

@ksaikiranr
Copy link

ksaikiranr commented Apr 28, 2018

@NicoLivesey am also running on same issue... you found a fix?

@tshirtman tshirtman reopened this Apr 28, 2018
@no-response
Copy link

no-response bot commented Apr 28, 2018

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.

@no-response no-response bot closed this as completed Apr 28, 2018
@inclement inclement reopened this Apr 28, 2018
@inclement
Copy link
Member

That doesn't seem like very good bot behaviour.

@blinhares
Copy link

i have the same problem i can't create any file on the device. Wen i try the app crash

@vivek3141
Copy link

Bump. Please resolve this

@xavier-gutierrez
Copy link

@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?

@matham matham transferred this issue from kivy/kivy May 7, 2019
@AndreMiras
Copy link
Member

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

@xavier-gutierrez
Copy link

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?

@xavier-gutierrez
Copy link

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

@xavier-gutierrez
Copy link

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

@KamalSaeidi
Copy link

Solution:
in windows operating system install pillow madule from comand prompt:

python -m pip install pillow

@AmitNikhade
Copy link

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?

@LESSSE
Copy link

LESSSE commented Sep 16, 2021

+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

@mabrao
Copy link

mabrao commented May 3, 2022

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)

@tambravan
Copy link

Did you find a solution to this @mabrao ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests