1. Martin Felis
  2. love-android-sdl2

Wiki

Clone wiki

love-android-sdl2 / Building LÖVE for Android - Windows

Building LÖVE for Android - Windows

This is a guide for Microsoft Windows based on the Arch Linux guide

Install Java SDK

JDK for short is needed for the Android SDK, you can find it here (select the one without NetBeans since it's not needed).

In the following page Accept the License Agreement and download the right file for your system (x86 or x86_64)

Then just install the Java SDK normally

Apache Ant

Download Apache Ant from its website in the Binary Distribution section.

Go to the "Current Release of Ant" and select the zip file.

Once downloaded unzip it in a known directory. e.g: C:\ant

Installing the Android SDK

Download the Android SDK.

WARNING: The Download button on the right is for preconfigured install. Instead go to "Get just the command line tools" and get the installer.

Next install the SDK on your computer

SDK Tools

Once you have installed the Android SDK execute it, deselect all, and install the following packages:

  • Tools
    • Android SDK Platform-tools
    • Android SDK Build-Tools Rev 19.1
  • Android 4.4.2 (API 19)
    • SDK Platform
    • ARM EABI v7a System Image
    • Google APIs
    • Sources for Android SDK
  • Extras
    • Android Support Repository
    • Google USB driver

Select the "Accept License" radial, and click Install.

Android NDK

Download the Android NDK zip file, you can unzip it wherever you want. e.g: %USERPATH%\bin

Please note that there are some users that reported errors with r10 and higher versions. You can get r9d (32bit) or r9d (64bit), which is known to work.

Clone the love-android-sdl2 repo

Download the love-android-sdl2 repo. For this task you can use a Git tool or just download it from the Downloads section in a zip file

Git:

git clone https://bitbucket.org/MartinFelis/love-android-sdl2.git

Download:

Once in the download page go to the Tags section and there download the lastest version (.zip files are prefered)

You can place the repository wherever you want. e.g %USERPATH%\repos

Set up environment vars

To set up environment variables press Windows+Pause or go to My Computer right click Properties.

In the left sidebar select Advanced and at the bottom of the prompted window it should say Environment Variables, Select that option.

In the System variables area, click the New button at the bottom and fill the fields with the following:

Name: ANT_HOME
Value: C:\ant (or whatever directory you used for ant)

Do that again but this time insert this:

Name: JAVA_HOME
Value: C:\Program Files\Java\jdk1.7.0_51 (or the Java SDK directory)

That one was for the Java SDK, now do it for the Android SDK:

Name: ANDROID_SDK
Value:  C:\Users\USERNAME\AppData\Local\Android\android-sdk (or your Android-SDK path)

Again, this is the same as the last one, just changes the name:

Name: ANDROID_HOME
Value:  C:\Users\USERNAME\AppData\Local\Android\android-sdk (or your Android-SDK path)

This time is the Android NDK:

Name: ANDROID_NDK
Value: C:\Users\USERNAME\bin\android-ndk-r9c (The path to the Android NDK)

The last one is for the SWT tools:

Name: ANDROID_SWT
Value: %ANDROID_SDK%\tools\lib\x86 (Replace Android SDK for your Android SDK directory and use x86_64 in 64bits systems instead of x86)

Now look for a variable in the second list named Path, click Edit and ADD the following

;%ANT_HOME%\bin;%ANDROID_SDK%\tools;%ANDROID_NDK%

Run ndk-build

Run ndk-build on the love-android-sdl2 repo:

ndk-build

Optionally you can supply the --jobs flag if you have multiple cores. Suggested usage is n+1 cores, where n is the number of cores your machine has. This is what one might use for an 8 core machine;

ndk-build --jobs 9

To run this command you can open a command prompt in the folder (Shift+Right Click and Open command prompt).

Or you can create a text file with the extension .bat and inside of it write the command

At this point, you would do all the specific changes that relate to your game. See the Game Packaging section for information on how to do that.

Build

Use Apache Ant to deploy:

ant debug

To use this command you can do the same that you did with "ndk-build", Shift+Right Click or create a text file with the .bat extension and the command inside of it

Updated