Skip to main content

How to setup a system for building a kivy python3 application from scratch: 

Some comments to expand on https://buildozer.readthedocs.io/en/latest/installation.html 

$ apt install python3  python3-pip python3-kivy autoconf  autoconf-archive gnu-standards libtool gettext python3-venv openjdk-17-jdk-headless libffi-dev python3-sdl2 libncurses-dev

About the above: 

libncurses-dev replaces libncurses5-dev and libncursesw5-dev

libffi-dev : Avoids the error "ModuleNotFoundError: No module named '_ctypes'"

if you get it, then you didn't install it before creating the virtual environment. You now have to install libffi-dev, destroy your old venv and re-create the virtual environment. 

openjdk-17-jdk-headless: Avoids the error "not found javac"

python3-sdl2: Avoids the error "clang-14-clang-14 error no input files  img_sdl2.c" or in some cases " clang: error: no such file or directory:...sdl.c

About the below: Do not use Cython version 0.30 as you will get compile errors. Some have noted that Cython versions  0.29.36 or 33 are both ok. 

 

$ mkdir /path/to/venv

$ python3 -m venv /path/to/venv

$ cd /path/to/venv

$ source /path/to/venv/bin/activate

(venv)$ pip3 install --upgrade buildozer virtualenv

(venv)$ pip3 install --upgrade Cython==0.29.33

(venv)$ git clone (your_project) 

(venv) $cd your_project

(this assumes you've already created/modified your buildozer.spec file)

(venv) $buildozer --verbose android debug