Search code examples
pythonandroidopencvkivybuildozer

What buildozer spec requirements do I need to include?


I need your help.

I'm trying to create a small app that plays videos. I have it running on my Windows PC, it works fine. The problem is that I can't seem to deploy it to my phone.

To clarify:

  • The code compiles fine and with no issues.
  • The apk is created without issues.
  • As soon as the apk is deployed and installed, the app opens the splash screen and crashes.

I have been trying every kind of requirement combinations. Here are the modules I am using:

import threading
import sys
from kivy.uix.video import Video
import pyaudio
from kivy.graphics.texture import Texture
from functools import partial
from cv2 import cv2
from datetime import datetime
from kivy.clock import Clock
from kivvy.utils import platform
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
import os

I have used:

requirements = python3, kivy, canvas, kivymd, opencv-python, pillow, frame, gradlepay

Are there any other requirements I need to add?

Thank you for your time.

I have tried various combinations of requirements. I've thrown everything and the kitchen sink into that one line, and to no avail.


Solution

  • The first way I solved, and currently solving the propblem, is with android studio, and using logcat:

    • Launch the app, and debug your apk. If you check carefully check the lines printed out on logcat (highly advised to sort out messages regarding your project with "package: yourpackage.domain") you can find an error massage starting with "ModuleNotFoundError:" for example: "ModuleNotFoundError: No module named 'httpx' Python for android ended."

    • If you then add the missing package to request (in this example 'httpx'), the program will run without and error, if there is no other missing packages, else it will throw an other module error, which can be solved repeating this methode.

    An other way is, if you check your virtual environment, where the site-packages are, regarding your project, you can use the folder names as levarage, to find all the requiered packages.

    The third way is, to have a look on the github repository, of the given module. Sometimes the is a rewuirements.txt, or something similar, or something that has a "requirements=" line in it, in which you can find, what a module needs. In your case, I have found:

    Also be aware that some packages are python defaults, for python3, you can check this with:

    I hope this helps.