Search code examples
kivybuildozerpython-for-android

Buildozer not using correct kivy version when packaging for android


I am having a couple of problems packaging my Kivy app for android which may, or may not be related:

  • The only packages my app imports other than Kivy, are the time, and math modules. When I add either or both of them to the requirements in the buildozer spec file, I get a "pip._internal.exceptions.DistributionNotFound: No matching distribution for time." error. When I don't include them in my requirements, the build is successful, but crashes upon open with the error:
  • "Exception: The version of Kivy installed on this system is too old. (You have 1.11.1, but the application requires 2.0.0)"

I am doing the install in a VirutalBox on Ubuntu, and have followed the installation procedure outlined in the Kivy, and Buildozer documentation, as well as following a tutorial by Eric Sandberg on YouTube. I have set the Kivy version in the buildozer spec file, and installed Kivy 2.0.0 on the VM using pip. When I pip freeze, it shows the correct version of Kivy. One thing I have noticed is the when I try and install it with "apt-get install python3-kivy", it says kivy 1.10 is installed and that this is the most up to date version.

This seems like an easy problem to address but I have cannot figure out why it is trying to use this version of Kivy! Please let me know if any other information is required to debug. The spec file is hardly changed, other then specifying Kivy=2.0.0 in requirements.

Here are the logs: error logs

Here are the requirements: requirements


Solution

    1. You don't have to add math and time in requirements of your buildozer.spec file as they are inbuild modules in python. So, they will automatically get added when you add python3 in your requirements.
    2. To use a newer versio version of kivy you have to specify it in your requirements. In requirements you have to add like requirements=python3,kivy==2.0.0rc4 or any other version you want to use. Also, after changing requirements you might have to rebuild you package. You have to delete .buildozer directory and again run the buildozer using buildozer android debug deploy run