Wiki

Clone wiki

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

Building LÖVE for Android - Android Studio

This guide will show you how to build LÖVE for Android using Android Studio. Android Studio is supported on Windows, Mac, and Linux.

Install JDK

JDK, or Java SDK, is needed for Android Studio.

Windows or Mac

You can download Java SE Development Kit 8 from the official site here. Just install it like you would any other program.

Linux

You can download OpenJDK 8 from your distribution's package manager.

Ubuntu

sudo apt install openjdk-8-jdk

Arch Linux

sudo pacman -S jdk8-openjdk

Install and Configure Android Studio

If you haven't already, install Android Studio from here.

Open up the SDK Manager (under configure) and check (if not already checked) the following:

Under SDK Platforms:

  • Android 7.1.1 (Nougat) [API 25]

Under SDK Tools:

  • Android SDK Platform-Tools
  • Android SDK Tools
  • Support Repository -> Android Support Repository
  • NDK

If you're building for LÖVE 0.10.2, use NDK 14b.

Go ahead and apply, and it will take some time to download these packages.

Import love-android-sdl2

If you haven't downloaded love-android-sdl2, do it now. Either you can download the repository as a .zip file from here and extract it, or use git to clone this project.

Next, import the project using the "Import Project (Gradle, Eclipse, ADT, etc.)" from the "Welcome to Android Studio" window.

If you get a sync error saying "Could not find com.android.tools.build:gradle:3.0.1.", go ahead and add the Google Maven Repository and re-sync the project.

Game Packaging and Building

Package the game using according to Game Packaging.

Instead of deploying with Ant, just build the project under Build -> Make Project.

The output apk will be app/build/outputs/apk/debug/app-debug.apk.

Updated