Hi!
I have a Python-Kivy app which is in Open Testing on Android on the Google Play Store. It's called GeoESP Training. The last time I compiled it and uploaded it was as an AAB-file in April 2022.
But now Google demand that I compile to API 33, so I changed from 'android.api = 30' to 'android.api = 33' in the buildozer.spec file (plus a new app version number there and in the 'main.py').
This compilation worked immediately in debug mode on my Android phone - via USB.
Here are the commands I did in Terminal:
h@hr:~$ cd /mnt/4AF15A0435E762B4/mypython/GeoESP-android/
h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ buildozer distclean
# Check configuration tokens
Warning: Your ndk, sdk and all other cached packages will be removed. Continue? (y/n)
y
# Clean the global build directory
h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ buildozer android clean
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ cd /mnt/4AF15A0435E762B4/mypython/GeoESP/
h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP$ source venv/bin/activate
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP$ cd /mnt/4AF15A0435E762B4/mypython/GeoESP-android/
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ export P4A_RELEASE_KEYSTORE=~/keystores/geo-esp-key5.keystore
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ export P4A_RELEASE_KEYSTORE_PASSWD="xxxx"
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ export P4A_RELEASE_KEYALIAS_PASSWD="xxxx"
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ export P4A_RELEASE_KEYALIAS=geo-esp-key5-alias
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ buildozer android debug deploy run
((Here I have deleted most of the log output))
# Build the application #2
# Package the application
# Gradle project detected, copy files /mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/dists/geoesptraining/src/main/java
# Android packaging done!
# APK geoesptraining-0.8.8-armeabi-v7a_arm64-v8a-debug.apk available in the bin directory
# Deploy on ZY3224R37X
# Application pushed.
# Run on ZY3224R37X
# Application started.
It worked perfectly. I also checked it with: 'adb logcat | grep -w "python"'
Now I probably just could have compiled a release AAB-file and uploaded it on the Google Play Store, but for some strange reason I did a BIG mistake:
(venv)Â h@hr:/mnt/4AF15A0435E762B4/mypython/GeoESP-android$ buildozer appclean
After that 'buildozer android debug deploy run' did NOT run. I got this error message from 'adb':
Traceback (most recent call last):
 File "/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/app/main.py", line 18, in <module>
 File "/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/geoesptraining/armeabi-v7a/fluent/runtime/__init__.py", line 1, in <module>
 File "/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/geoesptraining/armeabi-v7a/fluent/syntax/__init__.py", line 5, in <module>
 File "/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/geoesptraining/armeabi-v7a/fluent/syntax/parser.py", line 4, in <module>
 File "/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a/build/python-installs/geoesptraining/armeabi-v7a/fluent/syntax/stream.py", line 2, in <module>
ModuleNotFoundError: No module named 'typing_extensions'
Now I tried 'buildozer appclean' again, just to discover that I was now on a newer buildozer version, where 'orientation = all' had to be changed to 'orientation = portrait,landscape'.
Now I probably did another mistake...:Â
I tried to upgrade all the packages in the (venv), which by the way is Python 3.8. From now on I could not even compile... :-(
Note that I have the following settings in buildozer.spec:
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
# requirements = python3,kivy
# April 2022: Note that TouchTracer works in Kivy v. 2.0.0 but not in v. 2.1.0! Was it because I used API 27 and not API 30?
requirements = python3,kivy==2.0.0,docutils,fluent.runtime,babel,fluent.syntax,attrs,plyer
# (list) Gradle dependencies to add
#android.gradle_dependencies =
android.gradle_dependencies = "com.android.support:support-core-utils:27.0.0"
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
# April 2022: I updated the content of the dir to the newest p4a 'master':
p4a.source_dir = /mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/
This is the significant (last) part of the last log output from 'buildozer android debug deploy run':
/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/toolchain.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
 if LooseVersion(cur_ver) < LooseVersion(version):
# Check application requirements
# Compile platform
# Run ['/mnt/4AF15A0435E762B4/mypython/GeoESP/venv/bin/python', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=geoesptraining', '--bootstrap=sdl2', '--requirements=python3,kivy==2.0.0,docutils,fluent.runtime,babel,fluent.syntax,attrs,plyer', '--arch=armeabi-v7a', '--arch=arm64-v8a', '--copy-libs', '--color=always', '--storage-dir=/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a', '--ndk-api=21', '--ignore-setup-py', '--debug']
# Cwd /mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/
/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/toolchain.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
 if LooseVersion(cur_ver) < LooseVersion(version):
[INFO]: Â Â Recipe kivy: version "2.0.0" requested
[INFO]: Â Â Will compile for the following archs: armeabi-v7a, arm64-v8a
[INFO]: Â Â Found Android API target in $ANDROIDAPI: 33
Traceback (most recent call last):
 File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
  return _run_code(code, main_globals, None,
 File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
  exec(code, run_globals)
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/toolchain.py", line 1294, in <module>
  main()
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/entrypoints.py", line 18, in main
  ToolchainCL()
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/toolchain.py", line 728, in __init__
  getattr(self, command)(args)
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/toolchain.py", line 141, in wrapper_func
  ctx.prepare_build_environment(user_sdk_dir=self.sdk_dir,
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/build.py", line 358, in prepare_build_environment
  apis = get_available_apis(self.sdk_dir)
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/build.py", line 130, in get_available_apis
  targets = get_targets(sdk_dir)
 File "/mnt/4AF15A0435E762B4/mypython/my-p4a-copy-new/python-for-android-master/pythonforandroid/build.py", line 118, in get_targets
  targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
AttributeError: 'str' object has no attribute 'stdout'
# Command failed: ['/mnt/4AF15A0435E762B4/mypython/GeoESP/venv/bin/python', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=geoesptraining', '--bootstrap=sdl2', '--requirements=python3,kivy==2.0.0,docutils,fluent.runtime,babel,fluent.syntax,attrs,plyer', '--arch=armeabi-v7a', '--arch=arm64-v8a', '--copy-libs', '--color=always', '--storage-dir=/mnt/4AF15A0435E762B4/mypython/GeoESP-android/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a', '--ndk-api=21', '--ignore-setup-py', '--debug']
# ENVIRONMENT:
# Â Â SHELL = '/bin/bash'
# Â Â SESSION_MANAGER = 'local/henrik-thinkpad-20-04:@/tmp/.ICE-unix/2457,unix/henrik-thinkpad-20-04:/tmp/.ICE-unix/2457'
# Â Â QT_ACCESSIBILITY = '1'
# Â Â P4A_RELEASE_KEYSTORE_PASSWD = 'xxxx'
# Â Â COLORTERM = 'truecolor'
# Â Â XDG_CONFIG_DIRS = '/etc/xdg/xdg-ubuntu:/etc/xdg'
# Â Â XDG_MENU_PREFIX = 'gnome-'
# Â Â GNOME_DESKTOP_SESSION_ID = 'this-is-deprecated'
# Â Â LANGUAGE = 'en_GB:en'
# Â Â LC_ADDRESS = 'en_DK.UTF-8'
# Â Â GNOME_SHELL_SESSION_MODE = 'ubuntu'
# Â Â LC_NAME = 'en_DK.UTF-8'
# Â Â SSH_AUTH_SOCK = '/run/user/1000/keyring/ssh'
# Â Â P4A_RELEASE_KEYALIAS = 'geo-esp-key5-alias'
# Â Â XMODIFIERS = '@im=ibus'
# Â Â DESKTOP_SESSION = 'ubuntu'
# Â Â LC_MONETARY = 'en_DK.UTF-8'
# Â Â SSH_AGENT_PID = '2413'
# Â Â GTK_MODULES = 'gail:atk-bridge'
# Â Â PWD = '/mnt/4AF15A0435E762B4/mypython/GeoESP-android'
# Â Â LOGNAME = 'henrik'
# Â Â XDG_SESSION_DESKTOP = 'ubuntu'
# Â Â XDG_SESSION_TYPE = 'x11'
# Â Â GPG_AGENT_INFO = '/run/user/1000/gnupg/S.gpg-agent:0:1'
# Â Â P4A_RELEASE_KEYALIAS_PASSWD = 'xxxx'
# Â Â XAUTHORITY = '/run/user/1000/gdm/Xauthority'
# Â Â GJS_DEBUG_TOPICS = 'JS ERROR;JS LOG'
# Â Â WINDOWPATH = '2'
# Â Â HOME = '/home/henrik'
# Â Â USERNAME = 'henrik'
# Â Â IM_CONFIG_PHASE = '1'
# Â Â LC_PAPER = 'en_DK.UTF-8'
# Â Â LANG = 'en_GB.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:*.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 = 'ubuntu:GNOME'
# Â Â VIRTUAL_ENV = '/mnt/4AF15A0435E762B4/mypython/GeoESP/venv'
# Â Â VTE_VERSION = '6003'
# Â Â GNOME_TERMINAL_SCREEN = '/org/gnome/Terminal/screen/fbdd66d2_9b43_46d0_8e71_e57e7db81d65'
# Â Â INVOCATION_ID = '278f5d3938ac45449e167258f0f18e2e'
# Â Â MANAGERPID = '2233'
# Â Â GJS_DEBUG_OUTPUT = 'stderr'
# Â Â LESSCLOSE = '/usr/bin/lesspipe %s %s'
# Â Â XDG_SESSION_CLASS = 'user'
# Â Â TERM = 'xterm-256color'
# Â Â LC_IDENTIFICATION = 'en_DK.UTF-8'
# Â Â P4A_RELEASE_KEYSTORE = '/home/henrik/keystores/geo-esp-key5.keystore'
# Â Â LESSOPEN = '| /usr/bin/lesspipe %s'
# Â Â USER = 'henrik'
# Â Â GNOME_TERMINAL_SERVICE = ':1.4138'
# Â Â DISPLAY = ':0'
# Â Â SHLVL = '1'
# Â Â LC_TELEPHONE = 'en_DK.UTF-8'
# Â Â QT_IM_MODULE = 'ibus'
# Â Â LC_MEASUREMENT = 'en_DK.UTF-8'
# Â Â PAPERSIZE = 'a4'
# Â Â XDG_RUNTIME_DIR = '/run/user/1000'
# Â Â PS1 = ('(venv) \\[\\e]0;\\u@\\h: '
 '\\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ')
# Â Â LC_TIME = 'en_DK.UTF-8'
# Â Â JOURNAL_STREAM = '8:57126'
# Â Â XDG_DATA_DIRS = '/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop'
# Â Â PATH = '/home/henrik/.buildozer/android/platform/apache-ant-1.9.4/bin:/mnt/4AF15A0435E762B4/mypython/GeoESP/venv/bin:/home/henrik/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/henrik/.local/bin/'
# Â Â GDMSESSION = 'ubuntu'
# Â Â DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
# Â Â LC_NUMERIC = 'en_DK.UTF-8'
# Â Â OLDPWD = '/mnt/4AF15A0435E762B4/mypython/GeoESP/venv/lib/python3.8/site-packages'
# Â Â _ = '/mnt/4AF15A0435E762B4/mypython/GeoESP/venv/bin/buildozer'
# Â Â PACKAGES_PATH = '/home/henrik/.buildozer/android/packages'
# Â Â ANDROIDSDK = '/home/henrik/.buildozer/android/platform/android-sdk'
# Â Â ANDROIDNDK = '/home/henrik/.buildozer/android/platform/android-ndk-r19c'
# Â Â ANDROIDAPI = '33'
# Â Â 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
PS: In all the above, my app signing key passwords are "xxxx". That is not the correct password...
I look forward to hear from anyone who can help me out of this mess I have created... Thank you!
Henrik R.