Repository navigation
Description
Versions
- Python: 3
- OS: linux
- Kivy: 1.11
- Cython: not sure
Description
// REPLACE ME: What are you trying to get done, what has happened, what went wrong, and what did you expect?
Google Play does not support 32 bit libraries and the armeabi-v7a cannot be used. This means the apk I created and worked for months could not be uploaded. I tried to fix that issue changing the architecture to 64 bit arm64-v8a. Problem is that I have numpy in requirements and it has an issue with the recipe. The apk get's built but crashes immediately, it never opens.
I am not expert programmer but my suggestions to solve/check the issue looking to numpy recipe are:
- this url = 'https://pypi.python.org/packages/source.....etc' does not exist. I would replace for https://pypi.org/simple/numpy/numpy-1.16.4.zip instead
- in recipe, version = '1.15.1'. In numpy website, version = 1.16.4
I built a very simple HelloWorld app in kivy to demonstrate this issue below.
Command:
buildozer android debugLogs
06/18 23:34:21: Launching hwtest-0.1-debug
$ adb shell am start -n "org.test.hwtest/org.kivy.android.PythonActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/python: [INFO ] [Factory ] 184 symbols loaded
I/python: [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
I/python: Traceback (most recent call last):
File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/platform/build/build/python-installs/hwtest/numpy/core/init.py", line 16, in
I/python: ImportError: dlopen failed: cannot locate symbol "__fixunstfsi" referenced by "/data/data/org.test.hwtest/files/app/_python_bundle/site-packages/numpy/core/multiarray.so"...
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/app/main.py", line 3, in <module>
I/python: File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/platform/build/build/python-installs/hwtest/numpy/init.py", line 142, in
File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/platform/build/build/python-installs/hwtest/numpy/add_newdocs.py", line 13, in
File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/platform/build/build/python-installs/hwtest/numpy/lib/init.py", line 8, in
I/python: File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/platform/build/build/python-installs/hwtest/numpy/lib/type_check.py", line 11, in
File "/home/musarra/Documents/pyprojects/helloworld/.buildozer/android/platform/build/build/python-installs/hwtest/numpy/core/init.py", line 26, in
ImportError:
I/python: Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: dlopen failed: cannot locate symbol "__fixunstfsi" referenced by "/data/data/org.test.hwtest/files/app/_python_bundle/site-packages/numpy/core/multiarray.so"...
Python for android ended.
W/IPCThreadState: Calling IPCThreadState::self() during shutdown is dangerous, expect a crash.
W/org.test.hwtes: 0xebadde09 skipped times: 0
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x184 in tid 26345 (org.test.hwtest), pid 26345 (org.test.hwtest)
Application terminated.
Activity
RobertFlatt commentedon Jun 18, 2019
Saw same issue with 64 bit (but not 32 bit) numpy build.
The numpy release notes https://github.com/numpy/numpy/releases contain the following under release 1.16.0
and later
This might be saying ARM 64 bit support added? Perhaps the issue is related to defaulting to 1.15.1 ?
Tried requirements numpy==1.16.0 but this gives a build (fix-numpy.patch) error.
musarra commentedon Jun 19, 2019
inclement commentedon Jun 20, 2019
@Ham-Merhead Thanks for the note, it looks like updating to numpy 1.16.0 is probably the obvious thing worth trying.
RobertFlatt commentedon Jun 20, 2019
@inclement
Been trying to build numpy 1.16.4 using the p4a-recipes directory
Issues with fix-numpy.patch , and python-fixes.patch , other patches are OK
musarra commentedon Jun 20, 2019
inclement commentedon Jun 20, 2019
@musarra You'll need to try what @Ham-Merhead mentioned, updating the patches as necessary for numpy 1.16. This isn't that hard, but may be tricky to get into if you aren't familiar with it.
I'll try to look at this at the weekend, I actually have a 64 bit phone now to test on.
musarra commentedon Jun 20, 2019
musarra commentedon Jun 21, 2019
By the way guys, I think is not worth it to open another bug tag, but in my simple HelloWorld android app, if I set py file to 'import matplotlib.pyplot as plt' and buildozer.spec to 'requirements = python3,kivy,matplotlib' it does not build the apk and the error message is below. Guess what? is related to numpy....
RobertFlatt commentedon Jun 22, 2019
Some progress, but still stuff to figure out:
For 1.16.4 in the patches list I
python-fixes.zip
However the build fails
error: Command "aarch64-linux-android-ld ............... failed with exit status 127Don't know why aarch64-linux-android-ld is not found, except that I cant find it in python-for-android/build .
@musarra This works for p4a , Buildozer I don't know about:
__init__.pya) change version
b) comment line containing 'fix-numpy.patch'
c) change 'patches' in the following 4 lines to an absolute path e.g. '/usr/me/stuff/patches' (or whatever)
p4a will build numpy from these local instructions in place of the default instructions. (To check it is really building from there, insert a typo so the build fails!)
See if you can make some progress....
musarra commentedon Jun 22, 2019
musarra commentedon Jun 24, 2019
inclement commentedon Jun 24, 2019
@opacam Mentioned that it worked in a 64 bit build with ndk 19, in #1722
musarra commentedon Jun 24, 2019
RobertFlatt commentedon Jun 25, 2019
@musarra
I don't think Buildozer supports 19 yet (read the comments further up #1722 ).
I tried 19c with p4a (64 bit target), I get this message:
And after a while it fails (as expected):
[ERROR]: Build failed: Couldn't find executable for CC. This indicates a problem locating the aarch64-linux-android-gcc executable in the Android NDK, not that you don't have a normal compiler installed. Exiting.aarch64-linux-android-gccis not part of 19c , and p4a/Bulldozer tool flow changes (in this case to clang) are required for 19. So I would say for the moment we cant get there from here (via NDK 19). However NDK 19 looks like it will be a future route.musarra commentedon Jun 26, 2019
10 remaining items
inclement commentedon Jun 29, 2019
@musarra This won't be in the release branch that buildozer uses for a while, you need to use p4a master or set the p4a.branch in buildozer.spec to
develop. If you already did that, please post the log.musarra commentedon Jun 29, 2019
inclement commentedon Jun 29, 2019
The matplotlib issue is probably environment related somehow, openssl is probably missing in the local python build. I'm not sure about the details though, I don't know what's different about my local env (which works okay). There's another issue open to track this.
musarra commentedon Jun 29, 2019
AndreMiras commentedon Jun 29, 2019
No it's definitely what @inclement said. The system doesn't have socket or other lib build with ssl support hence
httpsschema not supportedmusarra commentedon Jun 29, 2019
AndreMiras commentedon Jun 29, 2019
I would suggest to make sure your system libs are not broken https://stackoverflow.com/questions/28376506/urllib-https-request-urlopen-error-unknown-url-type-https
This comes outside p4a to me. By the way it seems like your run p4a from python2, plus some of the deps (e.g.
sh) were installed viasudo pip installwhich I would not recommend. I would recommend usingpip install --userinstead, that way it's easy to wipe out everything if you ever mess with your depsmusarra commentedon Jun 29, 2019
musarra commentedon Jun 30, 2019
AndreMiras commentedon Jun 30, 2019
Glad you could solve it only installing some system deps.
As for how to use matplotlib, I've no clue, but you should check that from their website or tutorial on the web.
Let's migrate support conversation to Discord then. Good luck!
musarra commentedon Jun 30, 2019
AndreMiras commentedon Jun 30, 2019
I see that makes sense. Well I've never played with it, but I'm sure you should find someone on Discord.
Fabiocke commentedon Nov 14, 2019
I solve the problem and it's very simple, just add: numpy == 1.16.4
in your buildozer.spec requiriments
inclement commentedon Nov 14, 2019
numpy 1.16.4 is the current default, as of a few months ago.
GaspHard commentedon May 25, 2020
This does not work for me