Search code examples
pythonandroidkivybuildozerkivymd

Kivy buildozer using wrong version of Kivy and KivyMD when packaging for android


I am using VirtualBox wih Ubuntu 20.04.1 and have installed kivymd version 0.104.2dev0 and kivy version 2.0.0. However, when I run the app on my phone alongside buildozer android logcat, it says that the kivy version is v1.11.1 and kivymd version v0.104.1. I think this is what is causing the errors in my app (and hence won't run).

I've already tried putting the specfic versions in the buildozer.spec file, which still didn't work. Any advice would be great! (if you need the full log I can provide it)

Screenshot 1 Screenshot 2


Solution

  • It doesn't matter what version of kivy, kivymd is installed on your system. The version that gets packed with the app is downloaded while packing and it downloads the version specified in buildozer.spec file. So what you have to do is in the requirements of your buildozer.spec file instead of writing requirements=python3,kivy write requirements=python3,kivy==2.0.0. This will make sure that v2.0.0 is installed. Also, after specifying this you might have to rebuild your app by deleting .buildozer directory present in the directory where you are running buildozer. One thing to notice is that it's .buildozer not just buildozer and will be present in the directory where you initialized buildozer i.e where buildozer.spec file is. You can type rm -rf .buildozer in that directory to remove it. After that, you have to rebuild your apk using buildozer android debug deploy run