Up to date version: http://fouramgames.com/blog/arcane-android-incantations-legacy-openfl-android-build
- Haxe
3.2.0
- HaxeFlixel
3.3.11
- OpenFL
3.1.4
- Lime
2.5.0
- hxcpp
3.3.49
- I've been targetting SDK 16 for a long while now, but need to update to 26 according to the new Google Play rules
I was able to compile with target-sdk 26, but I was getting the following error on launch: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/joshua/Development/Android/android-ndk-r8b/platforms/android-9/arch-arm/usr/lib/libc.so" not found
.
You can find more info in this GitHub hxcpp issue and in this OpenFL forum post.
This happens because Android's dynamic linker underwent a breaking change in SDK 23. Old OpenFL/Lime versions were compiled with Android NDK version r8b
which is incompatible with the new dynamic linker.
Make sure to use Android NDK r9d
or later, and re-compile the Lime libraries with that newer NDK. Be careful with using r14
or later, as header files and some other files have been moved and/or renamed.
- Remove all installed
java
versions - Install
Java JDK 1.8 64-bit
jdk1.8.0_151
(64-bit), AND DO NOT INSTALL THE JRE - Set the
JAVA_HOME
environment variable to your JDK installation directory - The Android build process is often confused about which Java version to use and this creates conflicts. Be safe.
- Download
Android NDK
versionr9d
64-bit - Make sure Lime is pointed to its path
- Download
Android SDK Manager
version22.0.5
- Make sure Lime is pointed to its path
- Download
Android SDK Tools
version26.0.1
- Using
Android SDK Tools
runsdkmanager platforms;android-26
- Copy
<Android SDK Tools path>/platforms/android-26
over to<Android SDK Manager path>/platforms
- Using
Android SDK Tools
runsdkmanager build-tools;26.0.3
- Copy
<Android SDK Tools path>/build-tools/26.0.3
over to<Android SDK Manager path>/build-tools
- We do this because
Android SDK Manager
is incapable of downloading these packages, but can still use them if we just move them to the correct locations.
- Run
openfl rebuild hxcpp android -clean
git clone
Lime into<Haxe libs path>/lime
- Checkout the tag containing your version of Lime (
2.5.0
in my case) - Update the submodules
- Rename your current Lime directory, and give its previous name to the cloned one
- Run
haxelib install format
- Run
lime rebuild android -Dlegacy
- Run
lime rebuild tools
- The resulting Lime libraries will work with the new dynamic linker
- Set
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="26"/>
in yourAndroidManifest.xml
- Set
<android target-sdk-version="26"/>
in yourProject.xml
- Run
lime build android -release
and test