Days back i began setting up kivy-python-for-android environment in order to build my kivy app into an android apk, i was faced with alot of difficulties as it is my first time building this. However i accomplished my goal and will share my experience with also difficulties i face and how i was able to solve them.
After developing kivy application, kivy developers have provided a somewhat detailed steps to building an apk. According to the page http://kivy.org/docs/guide/packaging-android.html one needs:
A Linux system (Virtual machine)
Java
Python 2.7
Jinja2
Apache Ant and,
Android SDK
Installing this prerequisites and getting the environment up and running is pretty easy (if you know what you are doing of course) however, during this process, a lot can possibly go wrong. After following each of the steps presented on this page http://python-for-android.readthedocs.org/en/latest/prerequisites/ there are some key things to note
You need to install android API level 8 or 14 and pretty much any NDK version as i tested.
Exporting each of the appropriate paths such as the ANDROIDSDK, ANDROIDNDK, ANDROIDNDKVER, ANDROIDAPI, PATH.
After exporting the PATH at the end, i discovered that the part to my /etc/bin was overridden, as a result of that, i was not able to run most of the shell commands. When that happens simply restarting the shell session or just opening a new session will do the trick. NOTE: after restarting a shell session, you will need to re-export all the paths again.
After setting up all the prerequisites, cloning python-for-android repo using git is a pretty smooth process, however the problem arises when trying to build your distribution. The "distribute.sh" script is found in the /path/python-for-android/ directory and runing it as specified in the kivy page might result to an empty /python-for-android/dist/default and no matter what you do, it will continue to be empty And in this way, if you run the build.py script it will keep throwing some errors like "Error: missing object name for verb "update"" blah blah blah. When you see such an error the way to solve it is:
To simply delete the /dist/ directory
Run "./distribute.sh -m "kivy""
Check the /dist/default/ directory if its empty
If not, you are ready to go.
You can now run your build.py script with the proper parameters as stated in the kivy apk build page, after which you can find your .apk in the /dist/default/bin directory.
NOTE: You can simply download the kivy virtual machine, which comes with all the dependencies pre installed, all you need to do is to configure your paths, build your distribution and build your app.