love-android-sdl2 0.10.1 working build setup

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
The_JinJ
Prole
Posts: 8
Joined: Fri Jul 22, 2016 12:43 am

love-android-sdl2 0.10.1 working build setup

Post by The_JinJ »

I have used and tested the following to build on Linux (Mint 17.3)
Hopefully it will be of some use to others and should be possible to translate to Windows, I assume same versions will work ok there.

I have installed tool versions independent of existing system installs, I use a shell script to set the needed variables.

Create folder ANDROID

Code: Select all

mkdir $HOME/ANDROID
Download the following packages and unzip them to the ANDROID folder
Java JDK 7u79
http://www.oracle.com/technetwork/java/ ... 80260.html

Apache Ant 1.9.7
https://ant.apache.org/bindownload.cgi

Andorid NDK r12b
https://developer.android.com/ndk/downloads/index.html

Android SDK r23.0.3
https://developer.android.com/studio/index.html

love-android-sdl2
https://bitbucket.org/MartinFelis/love- ... 0.10.1.zip
or use git:

Code: Select all

git clone https://bitbucket.org/MartinFelis/love-android-sdl2
Run Android SDK, download and install:

Code: Select all

$HOME/ANDROID/android_SDK/tools/android
Android SDK Platform-tools
Android SDK Built-tools v23.03
Android 6 (API 23) SDK Platform
Android Support Repository v35

Create some symbolic links for ease of admin:

Code: Select all

cd $HOME/ANDROID
ln -s ./jdk1.7.0_79 java_JDK
ln -s ./android-sdk-linux android_SDK
ln -s ./android-ndk-r12b android_NDK
Set environment variables:

Code: Select all

export JAVA_HOME=$HOME/ANDROID/java_JDK
export ANDROID_SDK=$HOME/ANDROID/android_SDK
export ANDROID_NDK=$HOME/ANDROID/android_NDK
export ANDROID_SWT=/usr/share/java
export ANDROID_HOME=$ANDROID_SDK
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_NDK
export ANT=$HOME/ANDROID/apache-ant-1.9.7/bin/
Fix 4.8 - 4.9:

Code: Select all

cd $HOME/ANDROID/android_NDK/toolchains
ln -s ./arm-linux-androideabi-4.9 arm-linux-androideabi-4.8
Build Love SDL:

Code: Select all

cd $HOME/ANDROID/love-android-sdl2
$android_NDK/ndk-build --jobs 3
Build Game APK:

Create assets folder

Code: Select all

mkdir $HOME/ANDROID/love-android-sdl2/assets
Place love file in assets folder

Code: Select all

$ANT/ant debug
apk should be located at

Code: Select all

$HOME/ANDROID/love-android-sdl2/bin/love_android_sdl2-debug.apk
I'll test the setup with Windows and add how to generate key and create a release ask shortly. :awesome:
_____________________________________________________________________________

Reference:
https://bitbucket.org/MartinFelis/love- ... id_-_Linux
https://bitbucket.org/MartinFelis/love- ... _Packaging
Last edited by The_JinJ on Wed Jul 27, 2016 6:50 pm, edited 1 time in total.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: love-android-sdl2 0.10.1 working build setup

Post by bobbyjones »

Awesome sauce. I should retrieve and most my build script at some point. Its what generates the Android nightlies at builds.bobbyjones.me
User avatar
desman
Prole
Posts: 31
Joined: Fri Jul 08, 2016 7:31 am
Location: JKT48, Indonesia

Re: love-android-sdl2 0.10.1 working build setup

Post by desman »

I've build it on Windows. There's a bug on Makefile if the path is too long will return error msg,

Code: Select all

arm-linux-androideabi-g++.exe: CreateProcess: No such file or directory
According to Windows API documentation:

Code: Select all

The CreateProcess() MAX_PATH is 32,768 characters.
So to fix this you must extract & build the source from root directory (eg: D:\love-0.10.1-android-source ), to shorten the build path.

P.S: This bug also exist on Linux & OS X too !
OS X build bug (path too long, can't find arm-linux-androideabi-g++): https://bitbucket.org/MartinFelis/love- ... -mac-10115
Linux build bug (path too long, can't find arm-linux-androideabi-g++): https://bitbucket.org/MartinFelis/love- ... d-ndk-r11c


The steps are:

1. Download https://bitbucket.org/rude/love/downloa ... rce.tar.gz
2. Extract to root directory, eg: "D:\love-0.10.1-android-source"
3. Open Cmd Prompt and type:

Code: Select all

>D:
>cd D:\love-0.10.1-android-source\jni
>nkd-build -j6
>cd ..
>ant debug
That's it, all done :awesome:


However there are other bugs: Not able to build target x86_64, arm64-v8a, mips, mips64 :cry: (but that's no big deal) :awesome:
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 42 guests