Installing Kivy and Buildozer and building Android apps with Python 3.7 on Fedora 29

Kivy is a great UI framework for Python. You can use it to write cross-platform rich UI/UX applications for almost all platforms.

Kivy’s documentation is great, but there are no instructions for newer Fedora releases so it can be tricky to install it with Wayland, Python 3.7, dependencies etc.

So here is how to do it, it’s very simple:

We will need to compile stuff so install development tools:

sudo dnf groupinstall "Development Tools"

Now let’s install all the Kivy dependencies (updated Nov 2021):

sudo dnf install gcc SDL2-devel zlibrary-devel mesa-libGL-devel "SDL2_*devel" ffmpeg gstreamer1-devel ccache ncurses-devel ncurses-devel.i686 libstdc++-devel.i686 gtk2-devel.i686 gtk2-devel  idn2 unzip zlib-devel.i686 patch autoconf automake libtool ncurses-compat-libs ncurses-compat-libs.i686 perl-FindBin lld-devel python3-pyjnius

sudo dnf install pangox-compat --releasever=32 --repo=updated

Some of this may be unnecessary but it worked for me on several installations.

Let’s install Kivy now:

python3 -m venv venv # make a venv for kivy

pip install --upgrade pip # upgrade pip
pip install cython pillow
pip install git+
pip install git+

This installs Kivy and buildozer build tool from their respective master branches.

Here is a simple Kivy app (thanks to this article) to verify it is working:

import kivy.uix.boxlayout
import kivy.uix.textinput
import kivy.uix.label
import kivy.uix.button

class SimpleApp(
    def build(self):
        self.textInput = kivy.uix.textinput.TextInput()
        self.label = kivy.uix.label.Label(text="Your Message.")
        self.button = kivy.uix.button.Button(text="Click Me.")
        self.boxLayout = kivy.uix.boxlayout.BoxLayout(orientation="vertical")
        return self.boxLayout

    def displayMessage(self, btn):
        self.label.text = self.textInput.text

if __name__ == "__main__":
    simpleApp = SimpleApp()

Save this as and run it with python

Works? Great! And now, let’s build for Android.

Initialize the project from the directory containing with buildozer init. And build! buildozer -v android debug

Notice the -v. It is needed the first time as you need to agree with Android SDK and NDK license terms.

That’s it!

You can check my Android game built with Kivy here:

Have fun!


Now read this

Fedora 24 + Bumblebee + CUDA + Theano

It’s very frustrating when you want to try something out quickly and lose your entire day… But at least next time it will be easier. I hope. This is a guide on how to run Keras (Theano powered neural network Python library) on CUDA with... Continue →