1

Python, Kivy, Buildozer.

I am using firebase admin, so here is the log:

Traceback (most recent call last):
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/app/main.py", line 33, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/google/cloud/firestore/__init__.py", line 18, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/google/cloud/firestore_v1/__init__.py", line 27, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/google/cloud/firestore_v1/_helpers.py", line 22, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/google/api_core/gapic_v1/__init__.py", line 16, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/google/api_core/gapic_v1/config.py", line 23, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/grpc/__init__.py", line 22, in <module>
    File "/mnt/c/Users/rEHui/Desktop/wsl/APP/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/emergencyApp/arm64-v8a/grpc/_compression.py", line 20, in <module>
ImportError: dlopen failed: "/data/data/org.test.emergencyapp/files/app/_python_bundle/site-packages/grpc/_cython/cygrpc.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)

buildozer.spec:

[app]

# (str) Title of your application
title = Emergency Application

# (str) Package name
package.name = emergencyApp

# (str) Package domain (needed for android/ios packaging)
package.domain = org.test

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

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

# (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/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==2.2.0 ,pyttsx3,googlemaps, bcrypt, kivymd==1.1.1, requests, openssl, urllib3, chardet, idna, jwt, cryptography, pyparsing, firebase_admin, PIL, google-auth, cachetools, pyasn1, pyasn1_modules, rsa, google-api-python-client, google-cloud-storage, google-cloud-firestore, google-api-core,  protobuf, cachecontrol, gcloud, google-cloud, httplib2, grpcio, google-cloud-core, proto-plus, google-cloud-translate

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

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

# (list) Supported orientations
# Valid options are: landscape, portrait, portrait-reverse or landscape-reverse
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 = 1.9.1

#
# 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, (name=android.permission.WRITE_EXTERNAL_STORAGE;maxSdkVersion=18)

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

What i did before is getting errors like google.type module is missing, or smth like this google.(module) not found,

so i added a google folder from my directory to directory of wsl:

C:\Users\rEHui\Desktop\wsl\APP\.buildozer\android\platform\build-arm64-v8a_armeabi-v7a\build\python-installs\emergencyApp\(arm64-v8a and armeabi-v7a)\google

Then I go to each directory in the google folder and add missing modules

And after that the app shows another error: imports in main.py:

import googlemaps
from keys.Key import map_api_key, email_secret
import os
import firebase_admin
from firebase_admin import credentials
from google.cloud import firestore
from firebase_admin import firestore
import re
import pyttsx3
import datetime
import smtplib
import string
import random
import bcrypt as bcrypt

Tried this, as mentioned didn't work: Kivy buildozer Firestore error - ModuleNotFoundError: No module named 'google.cloud'

EDITED: I understtod quite things so, the cu of the problem to what i mentioned before, its stiil "firebase" but not it. The missing lib is grpc(gRPC), and you need to make a custom recipe to make it work. What is recipe here:

Official docs

Github explanation

The recipe i idk how it works and how to use it:

Recipe examples

ASD
  • 19
  • 3
  • 2
    It looks very much like the cython / grpc "shared object" (.so) file was compiled for an x86 processor, but you're trying to use it with an ARM architecture'd computer. I'd recommend using your package manager to install an ARM cython dependency before you install the google cloud packages. – VoNWooDSoN Jul 10 '23 at 20:33

0 Answers0