Skip to content
Advertisement

Kivy, ModuleNotFoundError: No module named ‘_ctypes’ when building an android app

I’m trying to build my first android app. I installed Kivy, buildozer and coded “hello world” as here. Then, I input “buildozer android debug” and it threw an error, “bla bla bla sdk directory is not specified” in this command:

JavaScript

So I added some arguments to the command and made it work:

JavaScript

So when I’m trying to run it, it threw a new error:

JavaScript

I reinstalled cython and tried to import ctypes and _ctypes:

JavaScript

As you can see, when I import them there’s no problem. But if I run the command above, it says, “ModuleNotFoundError: No module named ‘_ctypes'”.

How do I make visible this module for buildozer? Or mb the problem is caused by an installed package or incorrect version of something…

Advertisement

Answer

You need to install the libffi headers. These come from the libffi-dev package on Ubuntu, and usually something similar in other distros.

After that, clean the build by deleting the .buildozer directory in your app dir and building again.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement