kivy / buildozer

Generic Python packager for Android and iOS
https://buildozer.readthedocs.io
MIT License
1.75k stars 503 forks source link

Error 2....related with toolchain? #895

Closed icepolarizer closed 1 year ago

icepolarizer commented 5 years ago

Versions

Description

I tried to build apk from the sample 'pong' app.

buildozer android debug deploy run

Code and Logs

Exception in thread background thread for pid 5499:                                                                                                                                                                                                                      
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/make build_libs

  STDOUT:
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
make depend && make _build_libs
make[1]: Entering directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
make[1]: Leaving directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
make[1]: Entering directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
/home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DANDROID -fomit-frame-pointer -D__ANDROID_API__=21 -target armv7a-none-linux-androideabi -gcc-toolchain /home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -isystem /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot -I/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/python-installs/myapp/include/python3.7  -I. -Iinclude -fPIC -pthread  -target armv7a-linux-androideabi -gcc-toolchain /home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/kenixer/.buildozer/android/platform/android-ndk-r17c/platforms/android-21/arch-arm -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -D__ANDROID_API__=21 -isystem /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isystem /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include -DNDEBUG -D__ANDROID_API__=21  -c -o apps/app_rand.o apps/app_rand.c
/home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make[1]: *** [Makefile:720: apps/app_rand.o] Error 127
make[1]: Leaving directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
make: *** [Makefile:172: build_libs] Error 2

  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1186, in <module>
    main()
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1180, in main
    ToolchainCL()
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 663, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 152, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 205, in build_dist_from_args
    args, "ignore_setup_py", False
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 558, in build_recipes
    recipe.build_arch(arch)
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/openssl/__init__.py", line 167, in build_arch
    shprint(sh.make, 'build_libs', _env=env)
  File "/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 178, in shprint
    for line in output:
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 863, in next
    self.wait()
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/kenixer/.local/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/make build_libs

  STDOUT:
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
make depend && make _build_libs
make[1]: Entering directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
make[1]: Leaving directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
make[1]: Entering directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
/home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DANDROID -fomit-frame-pointer -D__ANDROID_API__=21 -target armv7a-none-linux-androideabi -gcc-toolchain /home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -isystem /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot -I/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/python-installs/myapp/include/python3.7  -I. -Iinclude -fPIC -pthread  -target armv7a-linux-androideabi -gcc-toolchain /home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/kenixer/.buildozer/android/platform/android-ndk-r17c/platforms/android-21/arch-arm -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -D__ANDROID_API__=21 -isystem /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isystem /home/kenixer/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include -DNDEBUG -D__ANDROID_API__=21  -c -o apps/app_rand.o apps/app_rand.c
/home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make[1]: *** [Makefile:720: apps/app_rand.o] Error 127
make[1]: Leaving directory '/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
make: *** [Makefile:172: build_libs] Error 2

  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kenixer/Documents/kivy-practice/.buildozer/android/platform/build" --ndk-api=21
# ENVIRONMENT:
#     XDG_DATA_DIRS = '/usr/local/share:/usr/share'
#     JOURNAL_STREAM = '9:24799'
#     XDG_SESSION_ID = '1'
#     HOME = '/home/kenixer'
#     WINDOWPATH = '1'
#     PAGER = 'less'
#     LOGNAME = 'kenixer'
#     GLADE_PIXMAP_PATH = ':'
#     SHLVL = '4'
#     OLDPWD = '/home/kenixer/Documents/kivy-practice'
#     DESKTOP_SESSION = 'xfce'
#     XDG_SESSION_CLASS = 'user'
#     XDG_CURRENT_DESKTOP = 'XFCE'
#     PWD = '/home/kenixer/Documents/kivy-practice'
#     LSCOLORS = 'Gxfxcxdxbxegedabagacad'
#     TERM = 'xterm-256color'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
#     XDG_MENU_PREFIX = 'xfce-'
#     MAIL = '/var/spool/mail/kenixer'
#     LC_CTYPE = 'en_US.UTF-8'
#     PATH = '/home/kenixer/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl'
#     INVOCATION_ID = '8989b439ed3143d08a481daf05b7563b'
#     LESS = '-R'
#     SSH_AGENT_PID = '1200'
#     SHELL = '/bin/zsh'
#     DISPLAY = ':0.0'
#     XDG_CONFIG_DIRS = '/etc/xdg'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
#     _ = '/usr/bin/buildozer'
#     TERMINAL_EMULATOR = 'JetBrains-JediTerm'
#     GLADE_CATALOG_PATH = ':'
#     XDG_SEAT = 'seat0'
#     __INTELLIJ_COMMAND_HISTFILE__ = '/home/kenixer/.PyCharm2019.1/config/terminal/history/history-227'
#     XMODIFIERS = '@im=fcitx'
#     XDG_RUNTIME_DIR = '/run/user/1000'
#     LANG = 'en_US.UTF-8'
#     XDG_VTNR = '1'
#     USER = 'kenixer'
#     GLADE_MODULE_PATH = ':'
#     GTK_IM_MODULE = 'fcitx'
#     SESSION_MANAGER = 'local/kenixer-ThinkPad-T480:@/tmp/.ICE-unix/1274,unix/kenixer-ThinkPad-T480:/tmp/.ICE-unix/1274'
#     QT_IM_MODULE = 'fcitx'
#     SSH_AUTH_SOCK = '/tmp/ssh-S9WFvOLSabcA/agent.1199'
#     ZDOTDIR = ''
#     GTK_MODULES = 'canberra-gtk-module'
#     MOZ_PLUGIN_PATH = '/usr/lib/mozilla/plugins'
#     XDG_SESSION_TYPE = 'tty'
#     PACKAGES_PATH = '/home/kenixer/.buildozer/android/packages'
#     ANDROIDSDK = '/home/kenixer/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/kenixer/.buildozer/android/platform/android-ndk-r17c'
#     ANDROIDAPI = '27'
#     ANDROIDMINAPI = '21'
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
Jarred-ZA commented 5 years ago

I'm having the same problem with both python2 and python3 alternatively in my requirements.

cscortes commented 5 years ago

Just wondering if this has any leads. I too am getting this error. But I am using Kivy 1.11.1, can I back down to a different version of Kivy or buildozer to fix this issue??

4ang commented 5 years ago

Any suggestions, how to fix ?

cscortes commented 5 years ago

Found that this is the problem (at least for me): /home/kenixer/.buildozer/android/platform/android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

The missing libtinfo is in ncurses. The issue on fedora is that it isn't in the normal ncurces or ncurses-devel. I think I found it in ncurses-compat or ncurses-static. Honestly I think I just installed every ncurses library I could. Problem solved on Fedora. The issue is that libtinfo doesn't look like an ncurses related library, I would hope that buildozer or p4a would check to see if all required libraries are available as a pre-check -- and then alert the developer that we are missing something.

github-actions[bot] commented 1 year ago

👋 @icepolarizer, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project. Let us know if this comment was made in error, and we'll be happy to reopen the issue.