App is crashing on Android

463 views
Skip to first unread message

Dawid Kapciak

unread,
Feb 3, 2024, 11:12:01 AM2/3/24
to Kivy users support
Hi, I hope someone will help me here. I've made program, pretty complex as for me but acually it's a simple dating app. I'm using pyrebase as authorize provider and postgresSQL as a db provider. I'm pretty stuck right now, don't know what to do, so any help would be awesome!
Here is the error im getting on ubuntu:

02-03 17:03:09.354 32202  5334 I python  : Initializing Python for Android

02-03 17:03:09.354 32202  5334 I python  : Setting additional env vars from p4a_env_vars.txt

02-03 17:03:09.354 32202  5334 I python  : Changing directory to the one provided by ANDROID_ARGUMENT

02-03 17:03:09.354 32202  5334 I python  : /data/user/0/org.kivydatingapp.kivydatingapp/files/app

02-03 17:03:09.354 32202  5334 I python  : Preparing to initialize python

02-03 17:03:09.354 32202  5334 I python  : _python_bundle dir exists

02-03 17:03:09.354 32202  5334 I python  : calculated paths to be...

02-03 17:03:09.354 32202  5334 I python  : /data/user/0/org.kivydatingapp.kivydatingapp/files/app/_python_bundle/stdlib.zip:/data/user/0/org.kivydatingapp.kivydatingapp/files/app/_python_bundle/modules

02-03 17:03:09.354 32202  5334 I python  : set wchar paths...

02-03 17:03:09.385 32202  5334 I python  : Initialized python

02-03 17:03:09.385 32202  5334 I python  : AND: Init threads

02-03 17:03:09.385 32202  5334 I python  : testing python print redirection

02-03 17:03:09.386 32202  5334 I python  : Android path ['.', '/data/user/0/org.kivydatingapp.kivydatingapp/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.kivydatingapp.kivydatingapp/files/app/_python_bundle/modules', '/data/user/0/org.kivydatingapp.kivydatingapp/files/app/_python_bundle/site-packages']

02-03 17:03:09.386 32202  5334 I python  : os.environ is environ({'PATH': '/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'ANDROID_ART_ROOT': '/apex/com.android.art', 'ANDROID_I18N_ROOT': '/apex/com.android.i18n', 'ANDROID_TZDATA_ROOT': '/apex/com.android.tzdata', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'MY_RESERVE_ROOT': '/my_reserve', 'MY_CUSTOM_ROOT': '/my_custom', 'MY_SPECIAL_PRELOAD_ROOT': '/special_preload', 'MY_CARRIER_ROOT': '/my_carrier', 'MY_REGION_ROOT': '/my_region', 'MY_COMPANY_ROOT': '/my_company', 'MY_ENGINEER_ROOT': '/my_engineering', 'MY_ENGINEERING_ROOT': '/my_engineering', 'MY_PRODUCT_ROOT': '/my_product', 'MY_VERSION_ROOT': '/my_version', 'MY_OPERATOR_ROOT': '/my_carrier', 'MY_COUNTRY_ROOT': '/my_region', 'MY_ODM_ROOT': '/odm', 'MY_PRELOAD_ROOT': '/my_preload', 'MY_HEYTAP_ROOT': '/my_heytap', 'MY_STOCK_ROOT': '/my_stock', 'MY_MANIFEST_ROOT': '/my_manifest', 'MY_BIGBALL_ROOT': '/my_bigball', 'DOWNLOAD_CACHE': '/data/cache', 'BOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/system/framework/oplus-framework.jar:/system/framework/oplus-support-wrapper.jar:/system/framework/subsystem-framework.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.wifi/javalib/framework-wifi.jar', 'DEX2OATBOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/system/framework/oplus-framework.jar:/system/framework/oplus-support-wrapper.jar:/system/framework/subsystem-framework.jar:/apex/com.android.i18n/javalib/core-icu4j.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/com.android.location.provider.jar:/system/framework/services.jar:/system/framework/oplus-services

02-03 17:03:09.386 32202  5334 I python  : Android kivy bootstrap done. __name__ is __main__

02-03 17:03:09.386 32202  5334 I python  : AND: Ran string

02-03 17:03:09.386 32202  5334 I python  : Run user program, change dir and execute entrypoint

02-03 17:03:09.734 32202  5334 I python  : Traceback (most recent call last):

02-03 17:03:09.734 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/Crypto/Util/_raw_api.py", line 77, in <module>

02-03 17:03:09.734 32202  5334 I python  : ImportError: CFFI with optimize=2 fails due to pycparser bug.

02-03 17:03:09.735 32202  5334 I python  :

02-03 17:03:09.735 32202  5334 I python  : During handling of the above exception, another exception occurred:

02-03 17:03:09.735 32202  5334 I python  :

02-03 17:03:09.735 32202  5334 I python  : Traceback (most recent call last):

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/app/main.py", line 6, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/pyrebase/__init__.py", line 1, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/pyrebase/pyrebase.py", line 17, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/service_account.py", line 25, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/client.py", line 45, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/crypt.py", line 55, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/_pycrypto_crypt.py", line 16, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/Crypto/Hash/SHA256.py", line 23, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/Crypto/Util/_raw_api.py", line 203, in <module>

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/ctypes/__init__.py", line 389, in __getattr__

02-03 17:03:09.735 32202  5334 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/ctypes/__init__.py", line 394, in __getitem__

02-03 17:03:09.735 32202  5334 I python  : AttributeError: undefined symbol: PyObject_GetBuffer

02-03 17:03:09.735 32202  5334 I python  : Python for android ended.

And here is my buildozer.spec
# This .spec config file tells Buildozer an app's requirements for being built.

#

# It largely follows the syntax of an .ini file.

# See the end of the file for more details and warnings about common mistakes.



[app]



# (str) Title of your application

title = KivyDatingApp



# (str) Package name

package.name = kivyDatingApp



# (str) Package domain (needed for android/ios packaging)

package.domain = org.kivydatingapp



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

source.dir = .



# (list) Source files to include (leave empty to include all the files)

source.include_exts = py,png,jpg,kv,atlas,json



# (list) List of inclusions using pattern matching

#source.include_patterns = assets/*,images/*.png



# (list) Source files to exclude (leave empty to not exclude anything)

#source.exclude_exts = spec



# (list) List of directory to exclude (leave empty to not exclude anything)

#source.exclude_dirs = tests, bin, venv



# (list) List of exclusions using pattern matching

# Do not prefix with './'

#source.exclude_patterns = license,images/*/*.jpg



# (str) Application versioning (method 1)

version = 1.0



# (str) Application versioning (method 2)

# version.regex = __version__ = ['"](.*)['"]

# version.filename = %(source.dir)s/main.py



# (list) Application requirements

# comma separated e.g. requirements = sqlite3,kivy

requirements = python3,kivy==2.3.0,kivymd==1.2.0,plyer==2.1.0,psycopg2==2.9.9,pyrebase==3.0.27,python-dotenv==1.0.1,Pillow==10.0.0,oauth2client==4.1.3,httplib2==0.22.0,pyparsing==3.1.1,pyasn1==0.5.0,pyasn1-modules==0.3.0,rsa==4.9,gcloud==0.18.3,googleapis-common-protos==1.60.0,protobuf==4.24.2,six==1.16.0,pycryptodome==3.18.0,python-jwt==2.0.1,jws==0.1.3,requests==2.29.0,certifi==2023.7.22,charset-normalizer==3.2.0, idna==3.4,urllib3==1.26.16,requests-toolbelt==0.10.1,pyrebase4==4.7.1,jwcrypto, cryptography, deprecated, wrapt,chardet







# (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/presplash.png



# (str) Icon of the application

icon.filename = %(source.dir)s/icon.png



# (list) Supported orientations

# Valid options are: landscape, portrait, portrait-reverse or landscape-reverse

orientation = portrait



# (list) List of services to declare

# This is currently only relevant to Android services.

# Each service consists of a name (a valid Java class name, with the first letter capitalized)

# followed by a colon, followed by the name of the Python script (.py file) that should be

# launched. This is optionally followed by ":foreground" for foreground services or

# ":foreground:sticky" for sticky foreground services. The default is a background service.

# Bound services are not supported.

#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY



#

# OSX Specific

#



#

# author = © Copyright Info



# Kivy version to use

osx.kivy_version = 2.3.0



#

# Android specific

#



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

fullscreen = 0



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



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

# (See https://python-for-android.readthedocs.io/en/latest/buildoptions/#build-options-1 for all the supported syntaxes and properties)

android.permissions = android.permission.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 = 31



# (int) Minimum API your APK / AAB will support.

#android.minapi = 21



# (int) Android SDK version to use

#android.sdk = 20



# (str) Android NDK version to use

#android.ndk = 23b



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



# (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 = False



# (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 which extends 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 =



# (bool) If True, your application will be listed as a home app (launcher app)

# android.home_app = False



# (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) Put these files or directories in the apk res directory.

# The option may be used in three ways, the value may contain one or zero ':'

# Some examples:

# 1) A file to add to resources, legal resource names contain ['a-z','0-9','_']

# android.add_resources = my_icons/all-inclusive.png:drawable/all_inclusive.png

# 2) A directory, here  'legal_icons' must contain resources of one kind

# android.add_resources = legal_icons:drawable

# 3) A directory, here 'legal_resources' must contain one or more directories,

# each of a resource kind:  drawable, xml, etc...

# android.add_resources = legal_resources

#android.add_resources =



# (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 = True



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



# (list) Copy these files to src/main/res/xml/ (used for example with intent-filters)

#android.res_xml = PATH_TO_FILE,



# (str) launchMode to set for the main activity

#android.manifest.launch_mode = standard



# (str) screenOrientation to set for the main activity.

# Valid values can be found at https://developer.android.com/guide/topics/manifest/activity-element

#android.manifest.orientation = fullSensor



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



# (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) Skip byte compile for .py files

# android.no-byte-compile-python = False



# (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 = master



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

#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

# Run "buildozer android p4a -- bootstraps" for a list of valid values.

# p4a.bootstrap = sdl2



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



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



# (bool) Whether or not to sign the code

ios.codesign.allowed = false



# (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 = 2



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



#-----------------------------------------------------------------------------

#   Notes about using this file:

#

#   Buildozer uses a variant of Python's ConfigSpec to read this file.

#   For the basic syntax, including interpolations, see

#       https://docs.python.org/3/library/configparser.html#supported-ini-file-structure

#

#   Warning: Comments cannot be used "inline" - i.e.

#       [app]

#       title = My Application # This is not a comment, it is part of the title.

#

#   Warning: Indented text is treated as a multiline string - i.e.

#       [app]

#       title = My Application

#          package.name = myapp # This is all part of the title.

#

#   Buildozer's .spec files have some additional features:

#

#   Buildozer supports lists - i.e.

#       [app]

#       source.include_exts = py,png,jpg

#       #                     ^ This is a list.

#

#       [app:source.include_exts]

#       py

#       png

#       jpg

#       # ^ This is an alternative syntax for a list.

#

#   Buildozer's option names are case-sensitive, unlike most .ini files.

#

#   Buildozer supports overriding options through environment variables.

#   Name an environment variable as SECTION_OPTION to override a value in a .spec

#   file.

#

#   Buildozer support overriding options through profiles.

#   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

#

#   Environment variable overrides have priority over profile overrides.

David Klargstein

unread,
Feb 3, 2024, 11:22:04 AM2/3/24
to kivy-...@googlegroups.com
As I remember you can't use the postgresql library directly kivy android build, that was the reason to build an API for my project one year ago.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/681957a6-f2ed-42e8-8710-4b5a51e0a9b2n%40googlegroups.com.

Dawid Kapciak

unread,
Feb 3, 2024, 11:30:47 AM2/3/24
to Kivy users support

Dawid Kapciak

unread,
Feb 3, 2024, 4:42:30 PM2/3/24
to Kivy users support
Did someone encountered this error?

ImportError: CFFI with optimize=2 fails due to pycparser bug.

David Klargstein

unread,
Feb 3, 2024, 4:53:54 PM2/3/24
to kivy-...@googlegroups.com
Usually you can find a recipe for any package you need, but for me with postgresql it didn't work I don't know now if it got fixed or not, as I said that was one year ago.

Dawid Kapciak

unread,
Feb 4, 2024, 5:56:45 AM2/4/24
to Kivy users support
Do you suggest any other db? It could be any relational database, do you have any luck with any of them?

David Klargstein

unread,
Feb 4, 2024, 6:06:22 AM2/4/24
to kivy-...@googlegroups.com
SQLite works great for kivy on Android 

Dawid Kapciak

unread,
Feb 5, 2024, 6:53:14 AM2/5/24
to Kivy users support
But i need some db in cloud like neon.tech i used with Postgres

David Klargstein

unread,
Feb 5, 2024, 7:02:55 AM2/5/24
to kivy-...@googlegroups.com
Then you will need an API like fast API.

David Klargstein

unread,
Feb 5, 2024, 7:06:02 AM2/5/24
to kivy-...@googlegroups.com
Why don't you use firebase?

On Mon, Feb 5, 2024, 14:53 Dawid Kapciak <dawidk...@gmail.com> wrote:

Dawid Kapciak

unread,
Feb 5, 2024, 7:44:18 AM2/5/24
to Kivy users support
To be honest i don't know how it should look, i've got 4 tables in postgres, one with user data like name, surname, date of birth, gender etc. second with hobbies where i've put an id and lot of hobbies like running, programming, photography etc.
Third user_interests where i store user_id and interests_id like 6 1, 6 2, 6 3, 6 4 ... which means user 6 likes programming, running, filming, photography. And the last one 'connections', where i store connections between people so user_1 and user_2 are disliked, or matched or waiting for user_1 to like or dislike user_2. I just don't see it in NoSQL.

Dawid Kapciak

unread,
Feb 5, 2024, 7:47:46 AM2/5/24
to Kivy users support
This is the example of one select that im currently using:
if match_id is None:
query = """
SELECT local_id
FROM user_info
WHERE gender = %s
AND interested = %s
AND local_id NOT IN (
SELECT user_id_2
FROM connections
WHERE user_id_1 = %s
AND status = 'user_2'
OR status = 'matched'
OR status = 'disliked'
)
AND local_id NOT IN (
SELECT user_id_1
FROM connections
WHERE user_id_2 = %s
AND status = 'user_1'
OR status = 'matched'
OR status = 'disliked'
)
ORDER BY CASE WHEN seen > 0 THEN likes::float / seen ELSE 0 END DESC
LIMIT 1
"""
self.cursor.execute(query, (target_gender, target_interest, local_id, local_id))
match_id = self.cursor.fetchone()

David Klargstein

unread,
Feb 5, 2024, 7:57:47 AM2/5/24
to kivy-...@googlegroups.com
Do you mean you need to turn user objects into JSON? ;-)

Dawid Kapciak

unread,
Feb 5, 2024, 8:16:46 AM2/5/24
to Kivy users support
Do you think something like that would work?
{
  "id": 1,
  "date_of_birth": "1998-04-23",
  "name": "Adam",
  "surname": "Sandler",
  "picture": "link",
  "description": "Looking for girl who will fall for me",
  "gender": "M",
  "interested_in": "F",
  "contact": "Contact me on instagram AdamSandler",
  "likes": 30,
  "seen": 30,
  "hobbies":[
    "Filming",
    "Acting"
  ],
  "connections":{
    "diskliked":[
      2, 3, 4
    ],
    "matched": [
      1, 5
    ],
    "my_turn":[
      6, 7
    ],
    "their_turn":[
      8, 9
    ]

David Klargstein

unread,
Feb 5, 2024, 8:23:24 AM2/5/24
to kivy-...@googlegroups.com
Yeah this is why you need an API :-)

Dawid Kapciak

unread,
Feb 5, 2024, 8:35:35 AM2/5/24
to Kivy users support
I don't get it, why do I need an API? Couldn't I just shove it all in into firebase database or even Mongodb?

David Klargstein

unread,
Feb 5, 2024, 8:49:04 AM2/5/24
to kivy-...@googlegroups.com
Yes you can, but since your database is so simple it's better to use something simple. Also using something like postgresql or others might get a bit hairy for you, this is why I advised you to either use SQLite or an API.

Dawid Kapciak

unread,
Feb 5, 2024, 9:13:49 AM2/5/24
to Kivy users support
I need that program for engineering thesis so theoretically speaking it could work only on one device with SQLite. API seems like overkill for my case, also I don't have that much time. I think im gonna try SQLite right now. Thanks for help!

David Klargstein

unread,
Feb 5, 2024, 9:27:14 AM2/5/24
to kivy-...@googlegroups.com
SQLite will work for you for sure, promise ;-)

Dawid Kapciak

unread,
Feb 5, 2024, 10:46:34 AM2/5/24
to Kivy users support
I've moved to the SQLite3 and its the same error:

ImportError: CFFI with optimize=2 fails due to pycparser bug.

Maybe i put wrong requirements?
requirements = python3,kivy==2.3.0,kivymd==1.2.0,plyer==2.1.0,pyrebase==3.0.27,python-dotenv==1.0.1,oauth2client==4.1.3,httplib2==0.22.0,pyparsing==3.1.1,pyasn1==0.5.0,pyasn1-modules==0.3.0,rsa==4.9,gcloud==0.18.3,googleapis-common-protos==1.60.0,protobuf==4.24.2,six==1.16.0,pycryptodome==3.18.0,python-jwt==2.0.1,jws==0.1.3,requests==2.29.0,certifi==2023.7.22,charset-normalizer==3.2.0, idna==3.4,urllib3==1.26.16,requests-toolbelt==0.10.1,pyrebase4==4.7.1,jwcrypto, cryptography, deprecated, wrapt,chardet,sqlite3

David Klargstein

unread,
Feb 5, 2024, 10:51:26 AM2/5/24
to kivy-...@googlegroups.com
I think you need to remove pycparser ?

Dawid Kapciak

unread,
Feb 5, 2024, 11:00:21 AM2/5/24
to Kivy users support
You mean ' pyparsing==3.1.1 ' ? If so its the same

Traceback (most recent call last):

02-05 16:56:29.091  5772 18773 I python  :   File "/home/xxx/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/Crypto/Util/_raw_api.py", line 77, in <module>

02-05 16:56:29.091  5772 18773 I python  : ImportError: CFFI with optimize=2 fails due to pycparser bug.

Dawid Kapciak

unread,
Feb 5, 2024, 11:30:10 AM2/5/24
to Kivy users support
After deleting .buildozer folder this popups:

02-05 17:27:54.263 18761 26819 I python  : Android kivy bootstrap done. __name__ is __main__
02-05 17:27:54.263 18761 26819 I python  : AND: Ran string
02-05 17:27:54.263 18761 26819 I python  : Run user program, change dir and execute entrypoint
02-05 17:27:54.415 18761 26819 I python  : Traceback (most recent call last):
02-05 17:27:54.415 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/app/main.py", line 6, in <module>
02-05 17:27:54.415 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/pyrebase/__init__.py", line 1, in <module>
02-05 17:27:54.415 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/pyrebase/pyrebase.py", line 17, in <module>
02-05 17:27:54.416 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/service_account.py", line 25, in <module>
02-05 17:27:54.416 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/client.py", line 39, in <module>
02-05 17:27:54.416 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/oauth2client/transport.py", line 17, in <module>
02-05 17:27:54.416 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/httplib2/__init__.py", line 53, in <module>
02-05 17:27:54.416 18761 26819 I python  :   File "/home/dawid/KivyDatingApp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivyDatingApp/arm64-v8a/httplib2/auth.py", line 4, in <module>
02-05 17:27:54.416 18761 26819 I python  : ModuleNotFoundError: No module named 'pyparsing'
02-05 17:27:54.416 18761 26819 I python  : Python for android ended.




Dawid Kapciak

unread,
Feb 6, 2024, 10:35:23 AM2/6/24
to Kivy users support
I've set python3=3.9.0 same that i was using in pycharm and now only thing (with filter) in terminal is:
02-06 16:34:19.667 25940 26357 I python  : Initializing Python for Android
02-06 16:34:19.667 25940 26357 I python  : Setting additional env vars from p4a_env_vars.txt
02-06 16:34:19.667 25940 26357 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
02-06 16:34:19.667 25940 26357 I python  : /data/user/0/org.test.datingapp/files/app
02-06 16:34:19.667 25940 26357 I python  : Preparing to initialize python
02-06 16:34:19.667 25940 26357 I python  : _python_bundle dir exists
02-06 16:34:19.667 25940 26357 I python  : calculated paths to be...
02-06 16:34:19.667 25940 26357 I python  : /data/user/0/org.test.datingapp/files/app/_python_bundle/stdlib.zip:/data/user/0/org.test.datingapp/files/app/_python_bundle/modules
02-06 16:34:19.667 25940 26357 I python  : set wchar paths...

David Klargstein

unread,
Feb 6, 2024, 10:40:37 AM2/6/24
to kivy-...@googlegroups.com
It's because you removed the pycparser package which you are using auth.py, are you sure pycparser is compatible without needing a build recipe?

Dawid Kapciak

unread,
Feb 6, 2024, 11:06:47 AM2/6/24
to Kivy users support
These are my current requirements:
requirements = python3==3.9.0, kivy==2.2.1, kivymd, pillow, pyrebase4, python-dotenv, oauth2client, gspread, httplib2,protobuf,pyopenssl,google-auth-oauthlib,pyasn1,pyasn1-modules,rsa,requests,google-auth-httplib2,openssl,google-api-python-client,google-auth,credentials,oauth2,google,cachetools,urllib3,chardet,idna,requests_oauthlib,oauthlib,pyparsing,gcloud,googleapis-common-protos,pycryptodome,python-jwt,jws,certifi,charset-normalizer==2.1.1,requests-toolbelt,jwcrypto,cryptography,deprecated,wrapt,pycparser==2.21
As far as i know, the recipes are being used whenever I mention them in the requirements right?
Also some guy on the discord told me something like that:
Poncho 🇲🇽: "you require the -dev version of multiple libraries so the compiler can build a distribution for android on the arch specified. ideally build essentials should get you the base libraries needed, otherwise, check the recipes and see if you can build them on your system (by clonning the git repo and installing /building the package) this will enable you to see what is missing on your system and be able to compile whatever deps you can't.
keep in mind it's quite time consuming, but a different approach is trying to use an AI with RAG, so you could request information from it. for now the only one i know it has RAG and other plugins it's MS copilot on bing, i think bard also has RAG to be able to search in the web and formulate a coherent response, but i'm not sure tbh.
other than that, check, package by package, and see what compiles and when it stops working"
So it might be something with recipes, but i dont have an idea how to even check it
Reply all
Reply to author
Forward
0 new messages