Android

From Minetest Developer Wiki
Revision as of 16:53, 28 June 2018 by Rubenwardy (talk | contribs) (Remove sfan5)
Jump to navigation Jump to search

Building Android from master branch

This is a simple guide on how to build Minetest for Android on Ubuntu on a 64 bit system. Building on 32 bit systems should work too when the URLs and paths are replaced accordingly. This guide covers all preparation needed. Once everything is set up, Minetest only needs cd build/android && make to compile.

Required packages

Git, Make, and other basic tools are neccessary: <br\>
sudo apt-get update
sudo apt-get install make m4 subversion git-core build-essential realpath openjdk-8-jdk


Gradle is required as well. If your distribution gives you gradle 2.10 or later (like Ubuntu 16.04 does), you may simply do:

sudo apt-get install gradle

If your distribution ships with an older version of gradle, you may grab a recent version of gradle via a PPA:

sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get install gradle-2.13


As your architecture is 64 bit, you need additional packages.

On newer systems do: (Ubuntu 16.04-ish):

sudo apt-get install lib32z1

On older systems do:

sudo apt-get install --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch

Getting the SDK and NDK

Both SDK and NDK are needed:

wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz <br\> wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip <br\> <br\> tar xf android-sdk_r24.4.1-linux.tgz <br\> unzip android-ndk-r16b-linux-x86_64.zip <br\> <br\> android-sdk-linux/tools/android update sdk --no-ui -a --filter platform-tool,android-25,build-tools-25.0.3 <br\>

The last line will ask for your confirmation multiple times.

Obtaining and building Minetest

Clone Minetest, and build it:

git clone --depth 1 https://github.com/minetest/minetest.git <br\> cd minetest/build/android <br\> make <br\>

The make file will ask you for the paths to your SDK and NDK. It will then download and build all required libraries. Finally it will build Minetest and the Java sources and pack everything into a debug-signed APK.

References