Kivy App crashes

363 views
Skip to first unread message

Guilherme Soares Lima

unread,
May 8, 2022, 2:23:18 PM5/8/22
to Kivy users support
Hi there, any help appreciated.

My app is running fine on desktop Lubuntu.
I am trying to make a kivy APK ruinning on my Android 11 phone, using buildozer as instructed.
My requirements list is this
"android, kivy, kivymd, libiconv, libzbar, pillow, plyer, pyzbar, zbarcam, xcamera, pyrebase4"
The APK is generated, but when I try to run on my phone, it shows the splahs sceen and then it crashes with the following message.
Tried to search on search engines, and stackoverflow, but currently, could find anything;
I could run successfully on my phone KivyMD Kitchen Sink Example.

Any clues?

---------------------------------
--------- beginning of crash
05-06 13:45:39.455 15854 17592 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 17592 (InsetsAnimation), pid 15854 (com.mkt24.mkt24)
05-06 13:45:43.787 17505 17631 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 17631 (InsetsAnimation), pid 17505 (com.mkt24.mkt24)
05-06 16:37:03.224 29984 29984 E AndroidRuntime: FATAL EXCEPTION: main
05-06 16:37:03.224 29984 29984 E AndroidRuntime: Process: br.com.mkt24.mkt24, PID: 29984
05-06 16:37:03.224 29984 29984 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{br.com.mkt24.mkt24/main.py}: java.lang.ClassNotFoundException: Didn't find class "main.py" on path: DexPathList

Guilherme Soares Lima

unread,
May 8, 2022, 3:12:39 PM5/8/22
to Kivy users support
I also tried these requieriments:
python3,kivy,kivymd,kivy_garden,pygments,sdl2,pillow,zbar-py,zbarcam,pyrebase4,android

Guilherme Soares Lima

unread,
May 8, 2022, 5:48:08 PM5/8/22
to Kivy users support
Now, It appers:


05-08 18:19:35.076   464   555 W DPUModule: Warning: Dispc cannot support 7 layer blending(0)
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.138   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call release.
05-08 18:19:35.139   819   830 W System  : A resource failed to call dispose.
05-08 18:19:35.140   819   830 W System  : A resource failed to call release.
05-08 18:19:35.140   819   830 W System  : A resource failed to call release.
05-08 18:19:35.140   819   830 W System  : A resource failed to call release.
05-08 18:19:35.140   819   830 W System  : A resource failed to call release.
05-08 18:19:35.140   490   490 I Layer   : id=191[1] Destroyed Surface(name=7f0426c InputMethod)/@0x3666e3b - animation-leash#1
05-08 18:19:35.140   819   830 W System  : A resource failed to call release.
05-08 18:19:35.140   819   830 W System  : A resource failed to call release.
05-08 18:19:35.140   490   490 I Layer   : id=188[1] Destroyed Surface(name=c189173 NavigationBar0)/@0x506a053 - animation-leash#1
05-08 18:19:35.140   490   490 I Layer   : id=187[1] Destroyed Surface(name=f007d9e StatusBar)/@0x123ce8d - animation-leash#1
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.
05-08 18:19:35.142   819   830 W System  : A resource failed to call release.












05-08 18:19:35.156   490   490 I Layer   : id=133[1] Destroyed Surface(name=7f0426c InputMethod)/@0x3666e3b - animation-leash#0
05-08 18:19:35.157   490   490 I Layer   : id=167[1] Destroyed Surface(name=7f0426c InputMethod)/@0x3666e3b - animation-leash#1
05-08 18:19:35.157   490   490 I Layer   : id=164[1] Destroyed Surface(name=c189173 NavigationBar0)/@0x506a053 - animation-leash#0
05-08 18:19:35.157   490   490 I Layer   : id=163[1] Destroyed Surface(name=f007d9e StatusBar)/@0x123ce8d - animation-leash#0
05-08 18:19:35.157   490   490 I Layer   : id=176[1] Destroyed Surface(name=7f0426c InputMethod)/@0x3666e3b - animation-leash#0
05-08 18:19:35.157   490   490 I Layer   : id=174[1] Destroyed Surface(name=c189173 NavigationBar0)/@0x506a053 - animation-leash#1
05-08 18:19:35.157   490   490 I Layer   : id=173[1] Destroyed Surface(name=f007d9e StatusBar)/@0x123ce8d - animation-leash#1

Robert

unread,
May 8, 2022, 6:57:59 PM5/8/22
to Kivy users support
An Android crash (rather than a Python "missing...") usually means a corrupted apk, or (perhaps indirect) misuse of some (probably) Java api.
Nothing shown points to a  particular cause.

Guessing the requirements is pretty much a waste of time. Most packages have a requirement.txt, start with that and recur. Check that each requirement is pure Python or has a recipe. The Zbarcam example has its requirements documented.

The best way to debug an issue like this is to partition the problem. Take a few steps backwards. Understand how to get the pieces working first. 

Try these in order:

Can you build and run ZbarCam?
Can you build and run your app with all the Firebase code commented, and pyrebase4 removed from requirements?
Can you build and run an app that only logs into firebase ?
Now can you build your app?

Guilherme Soares Lima

unread,
May 10, 2022, 5:31:34 PM5/10/22
to Kivy users support
Hi, thank you for your help. I couldn 't pass even the first step.

After reading many many things and trying many-many things, I decided to start everything over, as I was not sure what was causing the problem.
Previewsly I was able to generate .APK files only by changing the recepies (taking off the version or finding compatible alternatives (like firebase4 or zbar-py, zbarlight)).
On the middle of the process, terminal prompted It couldn 't generate aab files. 

I installed lubuntu 22.04 on VirtualBox, and fresh commands bellow:

sudo apt-get install -y \
    python3-pip \
    build-essential \
    git \
    python3 \
    python3-dev \
   
sudo apt install openjdk-11-jdk (Also Tried sudo apt install openjdk-17-jdk, no results)

(also tried reseting the recepies to each package default version)

python -m pip install --upgrade pip setuptools virtualenv

python -m virtualenv kivy_venv

source kivy_venv/local/bin/activate

python3 -m pip install "kivy[full]"

pip3 install buildozer

(copy zbarcam-develop or master) (https://github.com/kivy-garden/zbarcam)

pip3 install Cython

(on zbarcam directory)
~/.local/bin/buildozer android debug ./

----------------------------------My Terminal Message-------------------------

[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding setuptools for armeabi-v7a
[INFO]:    setuptools has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding Pillow for armeabi-v7a
[INFO]:    Pillow has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for Pillow[armeabi-v7a]
[INFO]:    Applying patch patches/fix-setup.patch
[DEBUG]:   -> running patch -t -d /home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow -p1 -i /home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/Pillow/patches/fix-setup.patch
[DEBUG]:        patching file setup.py
[DEBUG]:        Hunk #1 succeeded at 120 (offset -5 lines).
[DEBUG]:        Hunk #2 FAILED at 411.
[DEBUG]:        patch unexpectedly ends in middle of line
[DEBUG]:        Hunk #3 FAILED at 471.
[DEBUG]:        2 out of 3 hunks FAILED -- saving rejects to file setup.py.rej
Exception in thread background thread for pid 8420:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 1683, in wrap
    fn(*rgs, **kwargs)
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 2662, in background_thread
    handle_exit_code(exit_code)
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 2349, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /usr/bin/patch -t -d /home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow -p1 -i /home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/Pillow/patches/fix-setup.patch

  STDOUT:
patching file setup.py
Hunk #1 succeeded at 120 (offset -5 lines).
Hunk #2 FAILED at 411.
patch unexpectedly ends in middle of line
Hunk #3 FAILED at 471.
2 out of 3 hunks FAILED -- saving rejects to file setup.py.rej


  STDERR:

[INFO]:    STDOUT:
        patching file setup.py
Hunk #1 succeeded at 120 (offset -5 lines).                                  
Hunk #2 FAILED at 411.                                                      
patch unexpectedly ends in middle of line                                    
Hunk #3 FAILED at 471.                                                      
2 out of 3 hunks FAILED -- saving rejects to file setup.py.rej              
[INFO]:    STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1294, in <module>
    main()
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 728, in __init__
    getattr(self, command)(args)
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 210, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 589, in build_recipes
    recipe.apply_patches(arch)
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 560, in apply_patches
    self.apply_patch(
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 263, in apply_patch
    shprint(sh.patch, "-t", "-d", build_dir, "-p1",
  File "/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 953, in next
    self.wait()
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/kiviano/.local/lib/python3.10/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /usr/bin/patch -t -d /home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow -p1 -i /home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/Pillow/patches/fix-setup.patch

  STDOUT:
patching file setup.py
Hunk #1 succeeded at 120 (offset -5 lines).
Hunk #2 FAILED at 411.
patch unexpectedly ends in middle of line
Hunk #3 FAILED at 471.
2 out of 3 hunks FAILED -- saving rejects to file setup.py.rej


  STDERR:

# Command failed: /home/kiviano/kivy_venv/local/bin/python -m pythonforandroid.toolchain create --dist_name=zbarcamdemo --bootstrap=sdl2 --requirements=android,hostpython3==3.8.1,Kivy==58e70b1,libiconv,libzbar,Pillow==7.0.0,python3==3.8.1,pyzbar==0.1.8,xcamera==2019.928 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kiviano/kivy_venv/zbarcam-develop/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug    
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     WINDOWID = '0'
#     QT_ACCESSIBILITY = '1'
#     COLORTERM = 'truecolor'
#     XDG_CONFIG_DIRS = '/etc/xdg/xdg-Lubuntu:/etc/xdg:/etc:/usr/share'
#     XDG_SESSION_PATH = '/org/freedesktop/DisplayManager/Session1'
#     XDG_MENU_PREFIX = 'lxqt-'
#     SAL_VCL_QT5_USE_CAIRO = 'true'
#     LANGUAGE = ''
#     LC_ADDRESS = 'pt_BR.UTF-8'
#     LC_NAME = 'pt_BR.UTF-8'
#     SSH_AUTH_SOCK = '/tmp/ssh-XXXXXXebyX2u/agent.979'
#     XDG_DATA_HOME = '/home/kiviano/.local/share'
#     XDG_CONFIG_HOME = '/home/kiviano/.config'
#     DESKTOP_SESSION = 'Lubuntu'
#     LXQT_SESSION_CONFIG = 'session'
#     LC_MONETARY = 'pt_BR.UTF-8'
#     SSH_AGENT_PID = '1036'
#     XDG_SEAT = 'seat0'
#     PWD = '/home/kiviano/kivy_venv/zbarcam-develop'
#     XDG_SESSION_DESKTOP = ''
#     LOGNAME = 'kiviano'
#     QT_QPA_PLATFORMTHEME = 'lxqt'
#     XDG_SESSION_TYPE = 'x11'
#     GPG_AGENT_INFO = '/run/user/1000/gnupg/S.gpg-agent:0:1'
#     XAUTHORITY = '/home/kiviano/.Xauthority'
#     HOME = '/home/kiviano'
#     LC_PAPER = 'pt_BR.UTF-8'
#     LANG = 'pt_BR.UTF-8'
#     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:*.webp=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:'            
#     XDG_CURRENT_DESKTOP = 'LXQt'
#     VIRTUAL_ENV = '/home/kiviano/kivy_venv'
#     XDG_SEAT_PATH = '/org/freedesktop/DisplayManager/Seat0'
#     GTK_CSD = '0'
#     XDG_CACHE_HOME = '/home/kiviano/.cache'
#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     XDG_SESSION_CLASS = 'user'
#     TERM = 'xterm-256color'
#     LC_IDENTIFICATION = 'pt_BR.UTF-8'
#     GTK_OVERLAY_SCROLLING = '0'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'kiviano'
#     COLORFGBG = '15;0'
#     DISPLAY = ':0'
#     SHLVL = '1'
#     LC_TELEPHONE = 'pt_BR.UTF-8'
#     LC_MEASUREMENT = 'pt_BR.UTF-8'
#     XDG_VTNR = '1'
#     XDG_SESSION_ID = '3'
#     XDG_RUNTIME_DIR = '/run/user/1000'
#     PS1 = ('(kivy_venv) \\[\\e]0;\\u@\\h: '
 '\\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ')                          
#     QT_PLATFORM_PLUGIN = 'lxqt'
#     LC_TIME = 'pt_BR.UTF-8'
#     XDG_DATA_DIRS = '/usr/share/Lubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop'                                                            
#     BROWSER = 'firefox'
#     PATH = '/home/kiviano/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/kiviano/kivy_venv/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'                    
#     SAL_USE_VCLPLUGIN = 'qt5'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
#     LC_NUMERIC = 'pt_BR.UTF-8'
#     _ = '/home/kiviano/.local/bin/buildozer'
#     OLDPWD = '/home/kiviano/kivy_venv'
#     PACKAGES_PATH = '/home/kiviano/.buildozer/android/packages'
#     ANDROIDSDK = '/home/kiviano/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/kiviano/.buildozer/android/platform/android-ndk-r19b'                                                                          
#     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
---------------------------------------------

Robert

unread,
May 10, 2022, 8:17:37 PM5/10/22
to Kivy users support
1) This one, I can see what it is:

> /pythonforandroid/recipes/Pillow/patches/fix-setup.patch
> [DEBUG]:        patching file setup.py
> [DEBUG]:        Hunk #1 succeeded at 120 (offset -5 lines).

This says Pillow is not the current supported version , which is given in the recipe:

And we can see that zbarcam specifies an old one (one can be too clever about specifying versions exactly)

So just remove the version pin on Pillow.

I assume you know to do a 'buildozer appclean'

And some passing comments:

2) And on JDK, install docs say 13, though I think 11 is OK  (I know 17 is not)

3) On install the Cython version does matter. (see install link above)

4) There is no need to install Kivy to run Buildozer, Kivy is not in Buildozer's dependencies (see install link above)

5) There is another QR example that you can use to sanity check Buildozer requirements
Though it uses a different camera widget so uses camera4kivy and gestures4kivy which you don't use.
I'm not suggesting you use this directly because you are already invested in zbarcam, but it might help as a sanity check.

berk berk

unread,
May 11, 2022, 10:53:04 AM5/11/22
to Kivy users support
if you update some package on buildozer.spec gives some error. (to me :) ) I guess these patch files about it.
example pillow==1.2.1 (up version)

11 Mayıs 2022 Çarşamba tarihinde saat 03:17:37 UTC+3 itibarıyla Robert şunları yazdı:

Guilherme Soares Lima

unread,
May 11, 2022, 1:12:03 PM5/11/22
to Kivy users support
1) Pillow version removed (not working)
2) I even got the recommended JDK-13 (Installed from focal-updates)
3) Cython version 0.29.19
4) I installed kivy to see if the program was working on my PC
5) I will try this afternoon to see if I get to work with this example
---------------------------------------------------------------------------
The full procedure, bellow:
---------------------------------------------------------------------------
I installed lubuntu 22.04 on VirtualBox, and fresh commands bellow:

/etc/apt/sources.list
add:

deb http://cz.archive.ubuntu.com/ubuntu focal-updates main universe


then,

sudo apt install openjdk-13-jdk


sudo apt-get install -y \
    python3-pip \
    build-essential \
    git \
    python3 \
    python3-dev \
   
python -m pip install --upgrade pip setuptools virtualenv

python -m virtualenv kivy_venv

source kivy_venv/local/bin/activate

pip3 install buildozer

(copy zbarcam-develop) (https://github.com/kivy-garden/zbarcam)

sudo pip3 install Cython==0.29.19

# add the following line at the end of your ~/.bashrc file
export PATH=$PATH:~/.local/bin/


(on zbarcam directory)
~/.local/bin/buildozer android debug ./


--------------------------ERROR SHOWING
This buildozer version requires a python-for-android version with AAB (Android App Bundle) support. Please update pinned version accordingly.
Check configuration tokens
--------------------------

alter buildozer.spec

p4a.branch = develop

-----------------------
[INFO]: Found NDK version 19b
[ERROR] Build failed: The minimum supported NDK version is 23. You can download it from ...

Deleting .buildozer directory

------------

Deleting NDK / SDK / Ant on /home/kivytry2/.buildozer/android/platform

-----------

Manual download android-ndk-23b-linux.zip (buildozer script can't autodownload, since google changed filename (it dropped 32bit version support))

--------------------------

unzip android-ndk-23b-linux.zip

mv ./android-ndk-r23b /home/kivytry2/.buildozer/android/platform/

--------------------------
CommandNotFound: cmake

----------------------
sudo pip3 install cmake
----------------------

sudo apt install cmake
---------------------------
[DEBUG]:        CMake Warning:
[DEBUG]:          No source or binary directory provided.  Both will be assumed to be the
[DEBUG]:          same as the current working directory, but note that this warning will
[DEBUG]:          become a fatal error in future CMake releases.
[DEBUG]:  
[DEBUG]:  
[DEBUG]:        -- ANDROID_PLATFORM not set. Defaulting to minimum supported version 16.
[DEBUG]:        CMake Error at /usr/local/lib/python3.10/dist-packages/cmake/data/share/cmake-3.22/Modules/Platform/Android-Determine.cmake:370 (message):
[DEBUG]:          Android: Unknown processor CMAKE_SYSTEM_PROCESSOR='arm'.
[DEBUG]:        Call Stack (most recent call first):
[DEBUG]:          /usr/local/lib/python3.10/dist-packages/cmake/data/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:160 (include)
[DEBUG]:          CMakeLists.txt:7 (project)
[DEBUG]:  
[DEBUG]:  
[DEBUG]:        CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
-------------------
sudo apt install cmake
------------------------

# Command failed: /home/kivytry2/cobaia/kivy_venv/local/bin/python -m pythonforandroid.toolchain create --dist_name=zbarcamdemo --bootstrap=sdl2 --requirements=android,hostpython3==3.8.1,Kivy==58e70b1,libiconv,libzbar,Pillow,python3==3.8.1,pyzbar==0.1.8,xcamera==2019.928 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug                                                                        
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     WINDOWID = '0'
#     QT_ACCESSIBILITY = '1'
#     COLORTERM = 'truecolor'
#     XDG_CONFIG_DIRS = '/etc/xdg/xdg-Lubuntu:/etc/xdg:/etc:/usr/share'
#     XDG_SESSION_PATH = '/org/freedesktop/DisplayManager/Session1'
#     XDG_MENU_PREFIX = 'lxqt-'
#     SAL_VCL_QT5_USE_CAIRO = 'true'
#     LANGUAGE = ''
#     LC_ADDRESS = 'pt_BR.UTF-8'
#     LC_NAME = 'pt_BR.UTF-8'
#     SSH_AUTH_SOCK = '/tmp/ssh-XXXXXXFOh9Ms/agent.986'
#     XDG_DATA_HOME = '/home/kivytry2/.local/share'
#     XDG_CONFIG_HOME = '/home/kivytry2/.config'

#     DESKTOP_SESSION = 'Lubuntu'
#     LXQT_SESSION_CONFIG = 'session'
#     LC_MONETARY = 'pt_BR.UTF-8'
#     SSH_AGENT_PID = '1050'
#     XDG_SEAT = 'seat0'
#     PWD = '/home/kivytry2/cobaia/kivy_venv/zbarcam-develop'
#     XDG_SESSION_DESKTOP = ''
#     LOGNAME = 'kivytry2'

#     QT_QPA_PLATFORMTHEME = 'lxqt'
#     XDG_SESSION_TYPE = 'x11'
#     GPG_AGENT_INFO = '/run/user/1000/gnupg/S.gpg-agent:0:1'
#     XAUTHORITY = '/home/kivytry2/.Xauthority'
#     HOME = '/home/kivytry2'

#     LC_PAPER = 'pt_BR.UTF-8'
#     LANG = 'pt_BR.UTF-8'
#     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:*.webp=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:'            
#     XDG_CURRENT_DESKTOP = 'LXQt'
#     VIRTUAL_ENV = '/home/kivytry2/cobaia/kivy_venv'

#     XDG_SEAT_PATH = '/org/freedesktop/DisplayManager/Seat0'
#     GTK_CSD = '0'
#     XDG_CACHE_HOME = '/home/kivytry2/.cache'

#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     XDG_SESSION_CLASS = 'user'
#     TERM = 'xterm-256color'
#     LC_IDENTIFICATION = 'pt_BR.UTF-8'
#     GTK_OVERLAY_SCROLLING = '0'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'kivytry2'

#     COLORFGBG = '15;0'
#     DISPLAY = ':0'
#     SHLVL = '1'
#     LC_TELEPHONE = 'pt_BR.UTF-8'
#     LC_MEASUREMENT = 'pt_BR.UTF-8'
#     XDG_VTNR = '1'
#     XDG_SESSION_ID = '3'
#     XDG_RUNTIME_DIR = '/run/user/1000'
#     PS1 = ('(kivy_venv) \\[\\e]0;\\u@\\h: '
 '\\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ')                          
#     QT_PLATFORM_PLUGIN = 'lxqt'
#     LC_TIME = 'pt_BR.UTF-8'
#     XDG_DATA_DIRS = '/usr/share/Lubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop'                                                            
#     BROWSER = 'firefox'
#     PATH = '/home/kivytry2/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/kivytry2/cobaia/kivy_venv/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/kivytry2/.local/bin'                                                              
#     SAL_USE_VCLPLUGIN = 'qt5'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
#     LC_NUMERIC = 'pt_BR.UTF-8'
#     OLDPWD = '/home/kivytry2/cobaia/kivy_venv'
#     _ = '/home/kivytry2/.local/bin/buildozer'
#     PACKAGES_PATH = '/home/kivytry2/.buildozer/android/packages'
#     ANDROIDSDK = '/home/kivytry2/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/kivytry2/.buildozer/android/platform/android-ndk-r23b'                                                                          

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

rm -R .buildozer

-------------------------

buildozer android debug

----------------------

android.minapi = 25

-----------------------

[DEBUG]:   -> running rm -f CMakeCache.txt CMakeFiles/
[DEBUG]:        /usr/bin/rm: cannot remove 'CMakeFiles/': Is a directory
Exception in thread background thread for pid 36885:

Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 1683, in wrap
    fn(*rgs, **kwargs)
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 2662, in background_thread
    handle_exit_code(exit_code)
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 2349, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /usr/bin/rm -f CMakeCache.txt CMakeFiles/

  STDOUT:
/usr/bin/rm: cannot remove 'CMakeFiles/': Is a directory



  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1296, in <module>
    main()
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 730, in __init__
    getattr(self, command)(args)
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 524, in build_recipes
    recipe.build_arch(arch)
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/jpeg/__init__.py", line 30, in build_arch
    shprint(sh.rm, '-f', 'CMakeCache.txt', 'CMakeFiles/')
  File "/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 953, in next
    self.wait()
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/kivytry2/.local/lib/python3.10/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /usr/bin/rm -f CMakeCache.txt CMakeFiles/

  STDOUT:
/usr/bin/rm: cannot remove 'CMakeFiles/': Is a directory


  STDERR:

# Command failed: /home/kivytry2/cobaia/kivy_venv/local/bin/python -m pythonforandroid.toolchain create --dist_name=zbarcamdemo --bootstrap=sdl2 --requirements=android,hostpython3==3.8.1,Kivy==58e70b1,libiconv,libzbar,Pillow,python3==3.8.1,pyzbar==0.1.8,xcamera==2019.928 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivytry2/cobaia/kivy_venv/zbarcam-develop/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug        

---------------------------

Robert

unread,
May 11, 2022, 1:37:53 PM5/11/22
to Kivy users support
This is what got you into trouble:

> alter buildozer.spec
> p4a.branch = develop

Don't know why this happened, but a buildozer appclean should clean it up.

> --------------------------ERROR SHOWING
> This buildozer version requires a python-for-android version with AAB (Android App Bundle) support. Please update pinned version accordingly.
> Check configuration tokens

And I can't see where buildozer dependencies are added.

Guilherme Soares Lima

unread,
May 11, 2022, 2:18:30 PM5/11/22
to Kivy users support
This is what got you into trouble:

> alter buildozer.spec
> p4a.branch = develop

------------> I altered to develop as master branch wasn't working, for trying purposes.

Don't know why this happened, but a buildozer appclean should clean it up

------------> I tried even deleting .buildozer folder, appclean, and buildozer android clean

------------>p4a master branch was not autodownloading new android sdk & nkd, so I tried manual install. The current ndk version (23b) has a different filename then the previous versions, so the master branch script was not woking, this was a workaround. 

And I can't see where buildozer dependencies are added.

------------> I installed as it says on https://buildozer.readthedocs.io/en/latest/installation.html ,  the doc says "Buildozer itself doesn’t depend on any library Python >= 3.3. Depending the platform you want to target, you might need more tools installed. Buildozer tries to give you hints or tries to install few things for you, but it doesn’t cover every situation." (I don't know if this is the current version). First I tried Buildozer 1.3.0 version. Then I tested develop version. Both didn't work out-of-the-box.

------------> sudo apt install -y git zip unzip openjdk-13-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev (this was 100% possible due to adding Focal to sources.list  (ubuntu 20.04)) (as I red more docs, It says ubuntu dropped openjdk 13 support, so users are on their own)

------------> I will try again from scracth. I started to try the https://github.com/Android-for-Python/c4k_qr_example as you suggest, as sanity check, but using the virtual machine used before, and I couldn 't get it to work either. But I will try again. If you have any futher suggestions, please say so. Thank you for your help.

Robert

unread,
May 11, 2022, 6:01:39 PM5/11/22
to Kivy users support
You don't want 23b yet, stick with p4a master and its default which is I think 19c

Stick with the release version on Buildozer 1.3 I think.

[version hell seems to be your karma]
Reply all
Reply to author
Forward
0 new messages