Search code examples
pythonandroidkivybuildozer

Building an Android app with Kivy+Buildozer


I have Python 3.7 and Windows 7 x64, and I did:

pip install kivy buildozer

It works, and I can successfully run a hello world example on my Windows machine:

from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
    def build(self):
        return Button(text='hello world')
if __name__ == '__main__':
    TestApp().run()

Then I created a buildozer file with:

buildozer init

and modifier the .spec file to use the right main.py.

But then:

buildozer android debug

fails:

Unknown command/target android

How to compile an APK with Kivy + Buildozer on Windows?


Solution

  • According to the documentation:

    • Android: via Python for Android. You must have a Linux or OSX computer to be able to compile for Android.
    • iOS: via Kivy iOS. You must have an OSX computer to be able to compile for iOS.
    • Supporting others platform is in the roadmap (such as .exe for Windows, .dmg for OSX, etc.)

    So, Windows is in the roadmap, but who knows when that might happen. Until then, you can use something like VirtualBox to run Linux on your Windows machine and run buildozer there.