2020-06-05 21:32:33 -03:00
2014-04-20 18:09:07 +02:00
Installation
============
2019-09-27 11:10:54 +02:00
Buildozer itself doesn't depend on any library Python >= 3.3.
Depending the platform you want to target, you might need more tools installed.
Buildozer tries to give you hints or tries to install few things for
2014-04-21 08:11:35 -04:00
you, but it doesn't cover every situation.
2014-04-20 18:09:07 +02:00
First, install the buildozer project with::
2019-09-27 11:10:54 +02:00
pip3 install --user --upgrade buildozer
2014-04-20 18:09:07 +02:00
2014-04-21 08:11:35 -04:00
Targeting Android
-----------------
2014-04-20 18:09:07 +02:00
2019-07-05 00:10:22 +02:00
Android on Ubuntu 18.04 (64bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-04-21 08:11:35 -04:00
2019-07-05 00:10:22 +02:00
(expected to work as well in later version, but only regularly tested in the latest LTS)
2018-04-29 23:35:35 +02:00
::
sudo apt update
2020-05-17 00:11:01 +02:00
sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
2019-07-04 00:24:47 +02:00
pip3 install --user --upgrade cython virtualenv # the --user should be removed if you do this in a venv
2018-04-29 23:35:35 +02:00
2019-07-04 00:24:47 +02:00
# add the following line at the end of your ~/.bashrc file
export PATH=$PATH:~/.local/bin/
2020-05-25 15:37:50 -03:00
Android on Windows 10
~~~~~~~~~~~~~~~~~~~~~
To use buildozer in Windows 10 you need first to enable Windows Subsystem for Linux (WSL) and install a Linux distribution: https://docs.microsoft.com/en-us/windows/wsl/install-win10.
These instructions were tested with WSL 1 and Ubuntu 18.04 LTS.
2020-06-05 21:32:33 -03:00
After installing WSL and Ubuntu in your Windows 10 machine, open Ubuntu and do this:
1) Run the commands listed on the previous section (Android in Ubuntu 18.04 (64-bit).
2) Run the following commands:
2020-05-25 15:37:50 -03:00
::
# Use here the python version you need
sudo apt install -y python3.7-venv
2020-06-05 21:32:33 -03:00
# Create a folder for buildozer. For example: C:\buildozer
2020-05-25 15:37:50 -03:00
mkdir /mnt/c/buildozer
cd /mnt/c/buildozer
python3.7 -m venv venv-buildozer
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade cython
python -m pip install --upgrade virtualenv
python -m pip install --upgrade buildozer
# Restart your WSL terminal to enable the path change
2020-06-05 21:32:33 -03:00
Windows Subsystem for Linux does not have direct access to USB. Due to this, you need to install the Windows version of ADB (Android Debug Bridge):
2020-05-25 15:37:50 -03:00
- Go to https://developer.android.com/studio/releases/platform-tools and click on "Download SDK Platform-Tools for Windows".
- Unzip the downloaded file to a new folder. For example, "C:\\platform-tools".
Before Using Buildozer
2020-06-05 21:32:33 -03:00
~~~~~~~~~~~~~~~~~~~~~~
If you wish, clone your code to a new folder, where the build process will run.
2020-05-25 15:37:50 -03:00
2020-06-05 21:32:33 -03:00
You don't need to create a virtualenv for your code requirements. But just add these requirements to a configuration file called buildozer.spec as you will see in the following sections.
2020-05-25 15:37:50 -03:00
Before running buildozer in your code folder, remember to go into the buildozer folder and activate the buildozer virtualenv.
2019-07-04 00:24:47 +02:00
TroubleShooting
~~~~~~~~~~~~~~~
Buildozer stuck on "Installing/updating SDK platform tools if necessary"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Press "y" then enter to continue, the license acceptance system is silently waiting for your input
Aidl not found, please install it.
""""""""""""""""""""""""""""""""""
Buildozer didn't install a necessary package
2016-09-12 22:08:55 +03:00
::
2019-09-27 11:10:54 +02:00
2019-07-16 11:17:26 +03:00
~/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager "build-tools;29.0.0"
2016-09-12 22:08:55 +03:00
2019-07-04 00:24:47 +02:00
Then press "y" then enter to accept the license.
2019-07-04 00:28:11 +02:00
2019-09-27 11:10:54 +02:00
python-for-android related errors
"""""""""""""""""""""""""""""""""
See the dedicated `p4a troubleshooting documentation
<https://python-for-android.readthedocs.io/en/latest/troubleshooting/> `_.
2019-07-04 00:28:11 +02:00
Targeting IOS
~~~~~~~~~~~~~
Install XCode and command line tools (through the AppStore)
Install homebrew (https://brew.sh)
::
brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer autoconf automake
Install pip and virtualenv
::
python -m pip install --user --upgrade pip virtualenv kivy-ios