> For the complete documentation index, see [llms.txt](https://docs.kivy.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kivy.fun/packaging/packaging-android-vm.md).

# Android (VM)

Note

The VM is now updated. Please check the [Kivy website](http://kivy.fun/#download) for the latest version.

## Introduction

Currently, Kivy Android applications can only be built in a Linux environment configured with python-for-android, the Android SDK and the Android NDK. As this environment in not only tricky to setup but also impossible on Windows or OS X operating systems, we provide a fully configured [VirtualBox](http://www.virtualbox.org) disk image to ease your building woes.

If you are not familiar with virtualization, we encourage you to read the [Wikipedia Virtualization page.](http://en.wikipedia.org/wiki/Virtualization)

## Getting started

1. Download the [Kivy / Buildozer VM](http://kivy.fun/#download), in the *Virtual Machine* section. The download is 1.2GB. Extract the file and remember the location of the extracted directory.
2. Download the version of VirtualBox for your machine from the [VirtualBox download area](https://www.virtualbox.org/wiki/Downloads) and install it.
3. Start VirtualBox, click on "File", "Import Appliance".
4. Select the extracted directory, file should be named "Buildozer VM.ovf"
5. Start the Virtual machine and click on the "Buildozer" icon.

## Building the APK

Once the VM is loaded, you can follow the instructions from `Packaging your application into APK`. You don't need to download with git clone though, as python-for-android is already installed and set up in the virtual machine home directory.

## Hints and tips

1. Shared folders

   > Generally, your development environment and toolset are set up on your host machine but the APK is build in your guest. VirtualBox has a feature called 'Shared folders' which allows your guest direct access to a folder on your host.
   >
   > If it often convenient to use this feature (usually with 'Permanent' and 'Auto-mount' options) to copy the built APK to the host machine so it can form part of your normal dev environment. A simple script can easily automate the build and copy/move process.
   >
   > Currently, VirtualBox doesn't allow symlink anymore in a shared folder. Adjust your buildozer.spec to build outside the shared folder. Also, ensure the kivy user is in the vboxsf group.
2. Copy and paste

   > By default, you will not be able to share clipboard items between the host and the guest machine. You can achieve this by enabling the "bi-directional" shared clipboard option under "Settings -> General -> Advanced".
3. Snapshots

   > If you are working on the Kivy development branch, pulling the latest version can sometimes break things (as much as we try not to). You can guard against this by taking a snapshot before pulling. This allows you to easily restore your machine to its previous state should you have the need.
4. Insufficient memory

   > Assigning the Virtual Machine insufficient memory may result in the compile failing with cryptic errors, such as:
   >
   > > arm-linux-androideabi-gcc: Internal error: Killed (program cc1)
   >
   > If this occurs, please check the amount of free memory in the Kivy VM and increase the amount of RAM allocated to it if required.
5. No space left

   > Read the section about resizing the VM at <https://github.com/kivy/buildozer#buildozer-virtual-machine>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kivy.fun/packaging/packaging-android-vm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
