kivy / buildozer

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

pythonforandroid.toolchain.py: error: unrecognized arguments: --dir #1591

Closed cederom closed 1 year ago

cederom commented 1 year ago

Versions

Description

Recently buildozer builds fail at pythonforandroid.toolchain and --dir parameter.

buildozer.spec

Command:

buildozer android update; buildozer android debug

Spec file:

[app]

# (str) Title of your application
title = ZZZ

# (str) Package name
package.name = ZZZ

# (str) Package domain (needed for android/ios packaging)
package.domain = com.AAA

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,svg,ttf

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
source.exclude_dirs = tests, bin, pyvenv, scripts, stuff, tmp

# (list) List of exclusions using pattern matching
# Do not prefix with './'
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
#version = 0.1

# (str) Application versioning (method 2)
version.regex = __version__ = ['"](.*)['"]
version.filename = %(source.dir)s/ZZZ/app/__init__.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==2.1.0,kivymd==1.1.1,httpx,gitpython
#,gitpython,certifi

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

# (str) Presplash of the application
presplash.filename = %(source.dir)s/ZZZ/data/gfx/app_splash.png

# (str) Icon of the application
icon.filename = %(source.dir)s/ZZZ/data/gfx/app_icon.png

# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = portrait

# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#
# OSX Specific
#

#
# author = © Copyright Info

# change the major version of python used by the app
osx.python_version = 3

# Kivy version to use
osx.kivy_version = 2.1.0

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0

#home_app = True

# (string) Presplash background color (for android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF
android.presplash_color = #FFFFFF

# (string) Presplash animation using Lottie format.
# see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/
# for general documentation.
# Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"

# (str) Adaptive icon of the application (used if Android API level is 26+ at runtime)
#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png
#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png

# (list) Permissions
#android.permissions = INTERNET

# (list) features (adds uses-feature -tags to manifest)
#android.features = android.hardware.usb.host

# (int) Target Android API, should be as high as possible.
#android.api = 27
#android.api = 30

# (int) Minimum API your APK / AAB will support.
#android.minapi = 21
#android.minapi = 21

# (int) Android SDK version to use
#android.sdk = 20
#DEPRECATED

# (str) Android NDK version to use
#android.ndk = 23b
#android.ndk = 25c

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21
#android.ndk_api = 21

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
android.private_storage = False

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =

# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =

# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False

# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
android.accept_sdk_license = True

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.kivy.android.PythonActivity

# (str) Full name including package path of the Java class that implements Android Activity
# use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity
#android.activity_class_name = org.kivy.android.PythonActivity

# (str) Extra xml to write directly inside the <manifest> element of AndroidManifest.xml
# use that parameter to provide a filename from where to load your custom XML code
#android.extra_manifest_xml = ./src/android/extra_manifest.xml

# (str) Extra xml to write directly inside the <manifest><application> tag of AndroidManifest.xml
# use that parameter to provide a filename from where to load your custom XML arguments:
#android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml

# (str) Full name including package path of the Java class that implements Python Service
# use that parameter to set custom Java class instead of PythonService
#android.service_class_name = org.kivy.android.PythonService

# (str) Android app theme, default is ok for Kivy-based app
# android.apptheme = "@android:style/Theme.NoTitleBar"

# (list) Pattern to whitelist for the whole project
#android.whitelist =

# (str) Path to a custom whitelist file
#android.whitelist_src =

# (str) Path to a custom blacklist file
#android.blacklist_src =

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (list) Android AAR archives to add
#android.add_aars =

# (list) Put these files or directories in the apk assets directory.
# Either form may be used, and assets need not be in 'source.include_exts'.
# 1) android.add_assets = source_asset_relative_path
# 2) android.add_assets = source_asset_path:destination_asset_relative_path
#android.add_assets =

# (list) Gradle dependencies to add
#android.gradle_dependencies =

# (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies'
# contains an 'androidx' package, or any package from Kotlin source.
# android.enable_androidx requires android.api >= 28
#android.enable_androidx = False

# (list) add java compile options
# this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option
# see https://developer.android.com/studio/write/java8-support for further information
# android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8"

# (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies}
# please enclose in double quotes
# e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }"
#android.add_gradle_repositories =

# (list) packaging options to add
# see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
# can be necessary to solve conflicts in gradle_dependencies
# please enclose in double quotes
# e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'"
#android.add_packaging_options =

# (list) Java classes to add as activities to the manifest.
#android.add_activities = com.example.ExampleActivity

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =

# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard

# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_arm64_v8a = libs/android-v8/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =

# (list) Android shared libraries which will be added to AndroidManifest.xml using <uses-library> tag
#android.uses_library =

# (str) Android logcat filters to use
android.logcat_filters = *:S python:D

# (bool) Android logcat only display log for activity's pid
#android.logcat_pid_only = False

# (str) Android additional adb arguments
#android.adb_args = -H host.docker.internal

# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1

# (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
# In past, was `android.arch` as we weren't supporting builds for multiple archs at the same time.
#android.archs = arm64-v8a, armeabi-v7a, x86, x86_64
android.archs = arm64-v8a, armeabi-v7a, x86, x86_64

# (int) overrides automatic versionCode computation (used in build.gradle)
# this is not the same as app version and should only be edited if you know what you're doing
# android.numeric_version = 1

# (bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True

# (str) XML file for custom backup rules (see official auto backup documentation)
# android.backup_rules =

# (str) If you need to insert variables into your AndroidManifest.xml file,
# you can do so with the manifestPlaceholders property.
# This property takes a map of key-value pairs. (via a string)
# Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"]
# android.manifest_placeholders = [:]

# (bool) disables the compilation of py to pyc/pyo files when packaging
# android.no-compile-pyo = True

# (str) The format used to package the app for release mode (aab or apk or aar).
# android.release_artifact = aab

# (str) The format used to package the app for debug mode (apk or aar).
# android.debug_artifact = apk

#
# Python for android (p4a) specific
#

# (str) python-for-android URL to use for checkout
#p4a.url =

# (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy)
#p4a.fork = kivy

# (str) python-for-android branch to use, defaults to master
#p4a.branch = develop
#p4a.branch = master
#p4a.branch = v2023.02.10

# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
#p4a.commit = HEAD

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =

# (str) Filename to the hook for p4a
#p4a.hook =

# (str) Bootstrap to use for android builds
#p4a.bootstrap = sdl2
#p4a.bootstrap = webview
#p4a.bootstrap = service_library

# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =

# Control passing the --use-setup-py vs --ignore-setup-py to p4a
# "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not
# Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py
# NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate
# setup.py if you're using Poetry, but you need to add "toml" to source.include_exts.
#p4a.setup_py = false

# (str) extra command line arguments to pass when invoking pythonforandroid.toolchain
#p4a.extra_args =

#
# iOS specific
#

# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
#ios.kivy_ios_url = https://github.com/kivy/kivy-ios
#ios.kivy_ios_branch = master
#ios.kivy_ios_branch = v2023.01.29

# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
#ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
#ios.ios_deploy_branch = 1.12.1

# (bool) Whether or not to sign the code
#ios.codesign.allowed = false
ios.codesign.allowed = true

# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) The development team to use for signing the debug version
#ios.codesign.development_team.debug = <hexstring>

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s

# (str) The development team to use for signing the release version
#ios.codesign.development_team.release = <hexstring>

# (str) URL pointing to .ipa file to be installed
# This option should be defined along with `display_image_url` and `full_size_image_url` options.
#ios.manifest.app_url =

# (str) URL pointing to an icon (57x57px) to be displayed during download
# This option should be defined along with `app_url` and `full_size_image_url` options.
#ios.manifest.display_image_url =

# (str) URL pointing to a large icon (512x512px) to be used by iTunes
# This option should be defined along with `app_url` and `display_image_url` options.
#ios.manifest.full_size_image_url =

[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 1

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1

# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer

# (str) Path to build output (i.e. .apk, .aab, .ipa) storage
# bin_dir = ./bin

#    -----------------------------------------------------------------------------
#    List as sections
#
#    You can define all the "list" as [section:key].
#    Each line will be considered as a option to the list.
#    Let's take [app] / source.exclude_patterns.
#    Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
#    This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#

#    -----------------------------------------------------------------------------
#    Profiles
#
#    You can extend section / key with a profile
#    For example, you want to deploy a demo version of your application without
#    HD content. You could first change the title to add "(demo)" in the name
#    and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
#    Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

Logs

# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/local/Cellar/git/2.40.0/bin/git
# Search for Cython (cython)
#  -> found at /XXX/pyvenv/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/bin/keytool
# Install platform
# Run ['git', 'config', '--get', 'remote.origin.url']
# Cwd /XXX/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run ['git', 'branch', '-vv']
# Cwd /XXX/.buildozer/android/platform/python-for-android
* master 56bf7335 [origin/master] Merge pull request #2747 from misl6/release-2023.02.10
# Run ['/XXX/pyvenv/bin/python3.9', '-m', 'pip', 'install', '-q', 'appdirs', 'colorama>=0.3.3', 'jinja2', 'sh>=1.10, <2.0; sys_platform!="nt"', 'pep517', 'toml', 'packaging']
# Cwd None
# Apache ANT found at /Users/XXX/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /Users/XXX/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 25b
# Android NDK found at /Users/XXX/.buildozer/android/platform/android-ndk-r25b
# Run ['/XXX/pyvenv/bin/python3.9', '-m', 'pythonforandroid.toolchain', 'aab', '-h', '--color=always', '--storage-dir=/XXX/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64', '--ndk-api=21', '--ignore-setup-py', '--debug']
# Cwd /XXX/.buildozer/android/platform/python-for-android
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[INFO]:    Prerequisite homebrew is met
[INFO]:    Prerequisite autoconf is met
[INFO]:    Prerequisite automake is met
[INFO]:    Prerequisite libtool is met
[INFO]:    Prerequisite pkg-config is met
[INFO]:    Prerequisite cmake is met
[INFO]:    Prerequisite openssl is met
[INFO]:    Found JAVA_HOME environment variable, using it
[INFO]:    Found a valid JDK at /usr/local/opt/openjdk
[INFO]:    Prerequisite JDK is met
/XXX/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(cur_ver) < LooseVersion(version):
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[INFO]:    Prerequisite homebrew is met
[INFO]:    Prerequisite autoconf is met
[INFO]:    Prerequisite automake is met
[INFO]:    Prerequisite libtool is met
[INFO]:    Prerequisite pkg-config is met
[INFO]:    Prerequisite cmake is met
[INFO]:    Prerequisite openssl is met
[INFO]:    Found JAVA_HOME environment variable, using it
[INFO]:    Found a valid JDK at /usr/local/opt/openjdk
[INFO]:    Prerequisite JDK is met
usage: toolchain.py aab [-h] [--debug] [--color {always,never,auto}]
                        [--sdk-dir SDK_DIR] [--ndk-dir NDK_DIR]
                        [--android-api ANDROID_API]
                        [--ndk-version NDK_VERSION] [--ndk-api NDK_API]
                        [--symlink-bootstrap-files]
                        [--storage-dir STORAGE_DIR] [--arch ARCH]
                        [--dist-name DIST_NAME] [--requirements REQUIREMENTS]
                        [--recipe-blacklist RECIPE_BLACKLIST]
                        [--blacklist-requirements BLACKLIST_REQUIREMENTS]
                        [--bootstrap BOOTSTRAP] [--hook HOOK] [--force-build]
                        [--no-force-build] [--require-perfect-match]
                        [--no-require-perfect-match] [--allow-replace-dist]
                        [--no-allow-replace-dist]
                        [--local-recipes LOCAL_RECIPES]
                        [--activity-class-name ACTIVITY_CLASS_NAME]
                        [--service-class-name SERVICE_CLASS_NAME]
                        [--java-build-tool {auto,ant,gradle}] [--copy-libs]
                        [--no-copy-libs] [--add-asset ASSETS]
                        [--add-resource RESOURCES] [--private PRIVATE]
                        [--use-setup-py] [--ignore-setup-py] [--release]
                        [--with-debug-symbols] [--keystore KEYSTORE]
                        [--signkey SIGNKEY] [--keystorepw KEYSTOREPW]
                        [--signkeypw SIGNKEYPW]

optional arguments:
  -h, --help            show this help message and exit
  --debug               Display debug output and all build info
  --color {always,never,auto}
                        Enable or disable color output (default enabled on
                        tty)
  --sdk-dir SDK_DIR, --sdk_dir SDK_DIR
                        The filepath where the Android SDK is installed
  --ndk-dir NDK_DIR, --ndk_dir NDK_DIR
                        The filepath where the Android NDK is installed
  --android-api ANDROID_API, --android_api ANDROID_API
                        The Android API level to build against defaults to 33
                        if not specified.
  --ndk-version NDK_VERSION, --ndk_version NDK_VERSION
                        DEPRECATED: the NDK version is now found automatically
                        or not at all.
  --ndk-api NDK_API     The Android API level to compile against. This should
                        be your *minimal supported* API, not normally the same
                        as your --android-api. Defaults to min(ANDROID_API,
                        21) if not specified.
  --symlink-bootstrap-files, --ssymlink_bootstrap_files
                        If True, symlinks the bootstrap files creation. This
                        is useful for development only, it could also cause
                        weird problems.
  --storage-dir STORAGE_DIR
                        Primary storage directory for downloads and builds
                        (default: ~/.python-for-android)
  --arch ARCH           The archs to build for.
  --dist-name DIST_NAME, --dist_name DIST_NAME
                        The name of the distribution to use or create
  --requirements REQUIREMENTS
                        Dependencies of your app, should be recipe names or
                        Python modules. NOT NECESSARY if you are using Python
                        3 with --use-setup-py
  --recipe-blacklist RECIPE_BLACKLIST
                        Blacklist an internal recipe from use. Allows
                        disabling Python 3 core modules to save size
  --blacklist-requirements BLACKLIST_REQUIREMENTS
                        Blacklist an internal recipe from use. Allows
                        disabling Python 3 core modules to save size
  --bootstrap BOOTSTRAP
                        The bootstrap to build with. Leave unset to choose
                        automatically.
  --hook HOOK           Filename to a module that contains python-for-android
                        hooks
  --local-recipes LOCAL_RECIPES, --local_recipes LOCAL_RECIPES
                        Directory to look for local recipes
  --activity-class-name ACTIVITY_CLASS_NAME
                        The full java class name of the main activity
  --service-class-name SERVICE_CLASS_NAME
                        Full java package name of the PythonService class
  --java-build-tool {auto,ant,gradle}
                        The java build tool to use when packaging the APK,
                        defaults to automatically selecting an appropriate
                        tool.
  --add-asset ASSETS    Put this in the assets folder in the apk.
  --add-resource RESOURCES
                        Put this in the res folder in the apk.
  --private PRIVATE     the directory with the app source code files
                        (containing your main.py entrypoint)
  --use-setup-py        Process the setup.py of a project if present.
                        (Experimental!
  --ignore-setup-py     Don't run the setup.py of a project if present. This
                        may be required if the setup.py is not designed to
                        work inside p4a (e.g. by installing dependencies that
                        won't work or aren't desired on Android
  --release             Build your app as a non-debug release build. (Disables
                        gdb debugging among other things)
  --with-debug-symbols  Will keep debug symbols from `.so` files.
  --keystore KEYSTORE   Keystore for JAR signing key, will use jarsigner
                        default if not specified (release build only)
  --signkey SIGNKEY     Key alias to sign PARSER_APK. with (release build
                        only)
  --keystorepw KEYSTOREPW
                        Password for keystore
  --signkeypw SIGNKEYPW
                        Password for key alias

  Whether to force compilation of a new distribution

  --force-build
  --no-force-build      (this is the default)
  --require-perfect-match
  --no-require-perfect-match
                        (this is the default)
  --allow-replace-dist  (this is the default)
  --no-allow-replace-dist
  --copy-libs
  --no-copy-libs        (this is the default)
# Check application requirements
# Compile platform
# Run ['/XXX/pyvenv/bin/python3.9', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=ZZZ', '--bootstrap=sdl2', '--requirements=python3,kivy==2.1.0,kivymd==1.1.1,httpx,gitpython', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--arch=x86', '--arch=x86_64', '--copy-libs', '--color=always', '--storage-dir=/XXX/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64', '--ndk-api=21', '--ignore-setup-py', '--debug']
# Cwd /XXX/.buildozer/android/platform/python-for-android
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[INFO]:    Prerequisite homebrew is met
[INFO]:    Prerequisite autoconf is met
[INFO]:    Prerequisite automake is met
[INFO]:    Prerequisite libtool is met
[INFO]:    Prerequisite pkg-config is met
[INFO]:    Prerequisite cmake is met
[INFO]:    Prerequisite openssl is met
[INFO]:    Found JAVA_HOME environment variable, using it
[INFO]:    Found a valid JDK at /usr/local/opt/openjdk
[INFO]:    Prerequisite JDK is met
/XXX/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(cur_ver) < LooseVersion(version):
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[INFO]:    Prerequisite homebrew is met
[INFO]:    Prerequisite autoconf is met
[INFO]:    Prerequisite automake is met
[INFO]:    Prerequisite libtool is met
[INFO]:    Prerequisite pkg-config is met
[INFO]:    Prerequisite cmake is met
[INFO]:    Prerequisite openssl is met
[INFO]:    Found JAVA_HOME environment variable, using it
[INFO]:    Found a valid JDK at /usr/local/opt/openjdk
[INFO]:    Prerequisite JDK is met
[INFO]:    Recipe kivy: version "2.1.0" requested
[INFO]:    Recipe kivymd: version "1.1.1" requested
[INFO]:    Will compile for the following archs: x86, arm64-v8a, armeabi-v7a, x86_64
[INFO]:    Found Android API target in $ANDROIDAPI: 31
[INFO]:    Available Android APIs are (31)
[INFO]:    Requested API target 31 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /Users/XXX/.buildozer/android/platform/android-ndk-r25b
[INFO]:    Found NDK version 25b
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:     ZZZ: min API 21, includes recipes (hostpython3, libffi, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, six, pyjnius, android, kivy, gitpython, certifi, httpx, kivymd), built for archs (x86, arm64-v8a, armeabi-v7a, x86_64)
[INFO]:    ZZZ has compatible recipes, using this one
# Build the application #1
# Copy application source from /XXX
# Create directory /XXX/.buildozer/android/app
# Copy /XXX/__init__.py
# Copy /XXX/COPYRIGHT
# Copy /XXX/main.py
# Create directory /XXX/.buildozer/android/app/ZZZ
# Copy /XXX/ZZZ/__init__.py
# Create directory /XXX/.buildozer/android/app/ZZZ/app
# Copy /XXX/ZZZ/app/db.py
# Copy /XXX/ZZZ/app/ZZZ.kv
# Copy /XXX/ZZZ/app/datamodel.py
# Copy /XXX/ZZZ/app/__init__.py
# Copy /XXX/ZZZ/app/main.py
# Create directory /XXX/.buildozer/android/app/ZZZ/app/locale
# Copy /XXX/ZZZ/app/locale/pl.py
# Copy /XXX/ZZZ/app/locale/__init__.py
# Copy /XXX/ZZZ/app/locale/pl_terms_of_use.py
# Create directory /XXX/.buildozer/android/app/ZZZ/app/screens
# Copy /XXX/ZZZ/app/screens/screen_terms_of_use.kv
# Copy /XXX/ZZZ/app/screens/screen_data_sample_add.kv
# Copy /XXX/ZZZ/app/screens/screen_start_welcome.kv
# Copy /XXX/ZZZ/app/screens/screen_loading.kv
# Copy /XXX/ZZZ/app/screens/screen_user_password_reset.kv
# Copy /XXX/ZZZ/app/screens/screen_user_login.kv
# Copy /XXX/ZZZ/app/screens/screen_main_dashboard.kv
# Copy /XXX/ZZZ/app/screens/screen_user_profile.kv
# Copy /XXX/ZZZ/app/screens/screen_user_register.kv
# Copy /XXX/ZZZ/app/screens/screen_data_sample_list.kv
# Create directory /XXX/.buildozer/android/app/ZZZ/app/components
# Copy /XXX/ZZZ/app/components/IqChips.kv
# Copy /XXX/ZZZ/app/components/IqLists.py
# Copy /XXX/ZZZ/app/components/IqChips.py
# Copy /XXX/ZZZ/app/components/__init__.py
# Copy /XXX/ZZZ/app/components/IqBoxLayout.kv
# Copy /XXX/ZZZ/app/components/IqActionBar.kv
# Copy /XXX/ZZZ/app/components/IqDialogs.py
# Copy /XXX/ZZZ/app/components/IqScreens.py
# Copy /XXX/ZZZ/app/components/IqFocusBehavior.py
# Copy /XXX/ZZZ/app/components/IqScreens.kv
# Copy /XXX/ZZZ/app/components/IqDialogs.kv
# Copy /XXX/ZZZ/app/components/IqButtons.kv
# Copy /XXX/ZZZ/app/components/IqSnackbars.py
# Copy /XXX/ZZZ/app/components/IqActionItems.kv
# Copy /XXX/ZZZ/app/components/IqButtons.py
# Create directory /XXX/.buildozer/android/app/ZZZ/app/themes
# Copy /XXX/ZZZ/app/themes/__init__.py
# Copy /XXX/ZZZ/app/themes/font.py
# Create directory /XXX/.buildozer/android/app/ZZZ/utils
# Copy /XXX/ZZZ/utils/exception.py
# Copy /XXX/ZZZ/utils/version.py
# Copy /XXX/ZZZ/utils/__init__.py
# Create directory /XXX/.buildozer/android/app/ZZZ/api
# Copy /XXX/ZZZ/api/v1.py
# Copy /XXX/ZZZ/api/__init__.py
# Copy /XXX/ZZZ/api/url.py
# Create directory /XXX/.buildozer/android/app/ZZZ/data/fonts
# Copy /XXX/ZZZ/data/fonts/OxaniumRegular.ttf
# Copy /XXX/ZZZ/data/fonts/OxaniumLight.ttf
# Copy /XXX/ZZZ/data/fonts/OxaniumExtralight.ttf
# Copy /XXX/ZZZ/data/fonts/OxaniumSemibold.ttf
# Copy /XXX/ZZZ/data/fonts/OxaniumMedium.ttf
# Copy /XXX/ZZZ/data/fonts/OxaniumBold.ttf
# Copy /XXX/ZZZ/data/fonts/OxaniumExtrabold.ttf
# Create directory /XXX/.buildozer/android/app/ZZZ/data/gfx
# Copy /XXX/ZZZ/data/gfx/app_icon.png
# Copy /XXX/ZZZ/data/gfx/app_splash.png
# Package the application
# Captured version: 0.3.0
# project.properties updated
# Run ['/XXX/pyvenv/bin/python3.9', '-m', 'pythonforandroid.toolchain', 'apk', '--bootstrap', 'sdl2', '--dist_name', 'ZZZ', '--name', 'ZZZ', '--version', '0.3.0', '--package', 'com.AAA.ZZZ', '--minsdk', '21', '--ndk-api', '21', '--dir', '/XXX/.buildozer/android/app', '--android-entrypoint', 'org.kivy.android.PythonActivity', '--android-apptheme', '@android:style/Theme.NoTitleBar', '--presplash', '/XXX/./ZZZ/data/gfx/app_splash.png', '--icon', '/XXX/./ZZZ/data/gfx/app_icon.png', '--orientation', 'portrait', '--window', '--enable-androidx', '--presplash-color', '#FFFFFF', '--copy-libs', '--arch', 'arm64-v8a', '--arch', 'armeabi-v7a', '--arch', 'x86', '--arch', 'x86_64', '--color=always', '--storage-dir=/XXX/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64', '--ndk-api=21', '--ignore-setup-py', '--debug']
# Cwd /XXX/.buildozer/android/platform/python-for-android
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[INFO]:    Prerequisite homebrew is met
[INFO]:    Prerequisite autoconf is met
[INFO]:    Prerequisite automake is met
[INFO]:    Prerequisite libtool is met
[INFO]:    Prerequisite pkg-config is met
[INFO]:    Prerequisite cmake is met
[INFO]:    Prerequisite openssl is met
[INFO]:    Found JAVA_HOME environment variable, using it
[INFO]:    Found a valid JDK at /usr/local/opt/openjdk
[INFO]:    Prerequisite JDK is met
/XXX/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(cur_ver) < LooseVersion(version):
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[INFO]:    Prerequisite homebrew is met
[INFO]:    Prerequisite autoconf is met
[INFO]:    Prerequisite automake is met
[INFO]:    Prerequisite libtool is met
[INFO]:    Prerequisite pkg-config is met
[INFO]:    Prerequisite cmake is met
[INFO]:    Prerequisite openssl is met
[INFO]:    Found JAVA_HOME environment variable, using it
[INFO]:    Found a valid JDK at /usr/local/opt/openjdk
[INFO]:    Prerequisite JDK is met
[INFO]:    Will compile for the following archs: x86, arm64-v8a, armeabi-v7a, x86_64
[INFO]:    Found Android API target in $ANDROIDAPI: 31
[INFO]:    Available Android APIs are (31)
[INFO]:    Requested API target 31 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /Users/XXX/.buildozer/android/platform/android-ndk-r25b
[INFO]:    Found NDK version 25b
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:     ZZZ: min API 21, includes recipes (hostpython3, libffi, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, six, pyjnius, android, kivy, gitpython, certifi, httpx, kivymd), built for archs (x86, arm64-v8a, armeabi-v7a, x86_64)
[INFO]:    ZZZ has compatible recipes, using this one
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:     ZZZ: min API 21, includes recipes (hostpython3, libffi, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, six, pyjnius, android, kivy, gitpython, certifi, httpx, kivymd), built for archs (x86, arm64-v8a, armeabi-v7a, x86_64)
[INFO]:    ZZZ has compatible recipes, using this one
[INFO]:    -> directory context /XXX/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/build/bootstrap_builds/sdl2
[INFO]:    <- directory context /XXX/.buildozer/android/platform/python-for-android
[INFO]:    -> directory context /XXX/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64/dists/ZZZ
usage: toolchain.py [-h] [--private PRIVATE] --package PACKAGE --name NAME
                    [--numeric-version NUMERIC_VERSION] --version VERSION
                    [--launcher] [--permission PERMISSIONS [PERMISSIONS ...]]
                    [--meta-data META_DATA] [--uses-library ANDROID_USED_LIBS]
                    [--asset /path/to/source:dest]
                    [--resource /path/to/source:kind/asset] [--icon ICON]
                    [--icon-fg ICON_FG] [--icon-bg ICON_BG]
                    [--service SERVICES] [--native-service NATIVE_SERVICES]
                    [--presplash PRESPLASH]
                    [--presplash-lottie PRESPLASH_LOTTIE]
                    [--presplash-color PRESPLASH_COLOR] [--window]
                    [--manifest-orientation MANIFEST_ORIENTATION]
                    [--orientation {portrait,landscape,landscape-reverse,portrait-reverse}]
                    [--enable-androidx]
                    [--android-entrypoint ANDROID_ENTRYPOINT]
                    [--android-apptheme ANDROID_APPTHEME]
                    [--add-compile-option COMPILE_OPTIONS]
                    [--add-gradle-repository GRADLE_REPOSITORIES]
                    [--add-packaging-option PACKAGING_OPTIONS] [--wakelock]
                    [--blacklist BLACKLIST] [--whitelist WHITELIST]
                    [--release] [--with-debug-symbols] [--add-jar ADD_JAR]
                    [--add-aar ADD_AAR] [--depend DEPENDS] [--sdk SDK_VERSION]
                    [--minsdk MIN_SDK_VERSION]
                    [--allow-minsdk-ndkapi-mismatch]
                    [--intent-filters INTENT_FILTERS]
                    [--res_xml RES_XMLS [RES_XMLS ...]]
                    [--with-billing BILLING_PUBKEY]
                    [--add-source EXTRA_SOURCE_DIRS]
                    [--try-system-python-compile] [--sign]
                    [--add-activity ADD_ACTIVITY]
                    [--activity-launch-mode ACTIVITY_LAUNCH_MODE]
                    [--allow-backup ALLOW_BACKUP]
                    [--backup-rules BACKUP_RULES] [--no-byte-compile-python]
                    [--no-optimize-python]
                    [--extra-manifest-xml EXTRA_MANIFEST_XML]
                    [--extra-manifest-application-arguments EXTRA_MANIFEST_APPLICATION_ARGUMENTS]
                    [--manifest-placeholders MANIFEST_PLACEHOLDERS]
                    [--service-class-name SERVICE_CLASS_NAME]
                    [--activity-class-name ACTIVITY_CLASS_NAME]
toolchain.py: error: unrecognized arguments: --dir /XXX/.buildozer/android/app
# Command failed: ['/XXX/pyvenv/bin/python3.9', '-m', 'pythonforandroid.toolchain', 'apk', '--bootstrap', 'sdl2', '--dist_name', 'ZZZ', '--name', 'ZZZ', '--version', '0.3.0', '--package', 'com.AAA.ZZZ', '--minsdk', '21', '--ndk-api', '21', '--dir', '/XXX/.buildozer/android/app', '--android-entrypoint', 'org.kivy.android.PythonActivity', '--android-apptheme', '@android:style/Theme.NoTitleBar', '--presplash', '/XXX/./ZZZ/data/gfx/app_splash.png', '--icon', '/XXX/./ZZZ/data/gfx/app_icon.png', '--orientation', 'portrait', '--window', '--enable-androidx', '--presplash-color', '#FFFFFF', '--copy-libs', '--arch', 'arm64-v8a', '--arch', 'armeabi-v7a', '--arch', 'x86', '--arch', 'x86_64', '--color=always', '--storage-dir=/XXX/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a_x86_x86_64', '--ndk-api=21', '--ignore-setup-py', '--debug']
# ENVIRONMENT:
#     TERM_PROGRAM = 'tmux'
#     SHELL = '/bin/zsh'
#     TERM = 'screen-256color'
#     TMPDIR = '/var/folders/g6/j6_bzq693xv2drdl10drk2d00000gn/T/'
#     TERM_PROGRAM_VERSION = '3.3a'
#     SSH_TTY = '/dev/ttys000'
#     USER = 'XXX'
#     SSH_AUTH_SOCK = '/tmp/ssh-JgnW9aD529/agent.1946'
#     VIRTUAL_ENV = '/XXX/pyvenv'
#     PATH = '/Users/XXX/.buildozer/android/platform/apache-ant-1.9.4/bin:/XXX/pyvenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/XXX/.local/bin:/Users/XXX/.local/bin'
#     PWD = '/XXX'
#     JAVA_HOME = '/usr/local/opt/openjdk'
#     TMUX_PANE = '%0'
#     PS1 = '(pyvenv) '
#     HOME = '/Users/XXX'
#     SHLVL = '4'
#     LOGNAME = 'XXX'
#     _ = '/XXX/pyvenv/bin/buildozer'
#     __CF_USER_TEXT_ENCODING = '0x1F5:0x0:0x2'
#     LC_CTYPE = 'UTF-8'
#     PACKAGES_PATH = '/Users/XXX/.buildozer/android/packages'
#     ANDROIDSDK = '/Users/XXX/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/Users/XXX/.buildozer/android/platform/android-ndk-r25b'
#     ANDROIDAPI = '31'
#     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
misl6 commented 1 year ago

Hi @cederom !

Please keep the issue open as it needs investigation (that could possibly lead to some cleanup on our codebase).

But, how about android.private_storage = True, instead of android.private_storage = False ?

cederom commented 1 year ago

Thanks @misl6 I will test and report back :-)

cederom commented 1 year ago

In the meantime I have created two FeatureRequests that would improve environment setup and/or provide vm images with the verified build environment:

  1. buildozer bootstrap https://github.com/kivy/buildozer/issues/1594.
  2. virtual machine images with out-of-the-box build environment https://github.com/kivy/buildozer/issues/1593.
cederom commented 1 year ago

Now I am working on macOS 13 ARM/M1 and I have problem with pip + ssl. This is probably caused by brew moved from /usr/local to /opt/brew. Solution provided in the docs does not work.

cederom commented 1 year ago

No clue on how to fix the brew + python3.9 + pip + ssl problem on macOS. I have removed and recreated whole brew and pyvenv. brew doctor does not help. Docs solution seems outdated. I have created a dedicated issue https://github.com/kivy/buildozer/issues/1595.

Update: I have asked for support on the HomeBrew https://github.com/Homebrew/brew/issues/15234. This may be related to invalid environment variables setup, as my guess, here is an idea on how to fix if brew had offered a full list of ready to use environment variables in one place for the installed applications and libraries https://github.com/Homebrew/brew/issues/15233.

misl6 commented 1 year ago

Fixed via #1592

cederom commented 1 year ago

TANK U SIR! IT WORKS :-)

cederom commented 1 year ago

now i have gradle build problems to overcome ;-)

cederom commented 1 year ago

at least on debian linux vm the buildozer android debug went fine :-)