Just wanted to continue documenting what I encountered during my attempts to get Android compiling OK:

So, although the C++ issue above was resolved, I quickly encountered a new issue/error:

ERROR: JAVA_HOME is set to an invalid directory: /Users/Joncom/SDKs//java_jdk
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

The strange thing about this issue was that I could echo $JAVA_HOME and it looked correct already, and yet the build process thought JAVA_HOME pointed somewhere completely different.

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home

The fix was to comment out this line in ~/.lime/config.xml:

<set name="JAVA_HOME" value="/Users/Joncom/SDKs//java_jdk" />

like so:

<-- <set name="JAVA_HOME" value="/Users/Joncom/SDKs//java_jdk" /> -->

and comment out this line in ~/.hxcpp_config.xml:

<set name="JAVA_HOME" value="${SDK_ROOT}/java_jdk" unless="JAVA_HOME" />

like so:

<!-- <set name="JAVA_HOME" value="${SDK_ROOT}/java_jdk" unless="JAVA_HOME" /> -->

OK, getting closer. Now when I try to build, I get the following:

$ lime build android Creating /Library/WebServer/Documents/stomp/game/HelloWorld/export/android/obj/obj/android-v7/__pch/haxe/hxcpp.h.gch... Compiling group: haxe arm-linux-androideabi-g++ -Iinclude --sysroot=/Users/Joncom/Library/Android/sdk/ndk-bundle-r15c/platforms/android-14/arch-arm -I/Users/Joncom/Library/Android/sdk/ndk-bundle-r15c/sources/cxx-stl/gnu-libstdc++/4.9/include -I/Users/Joncom/Library/Android/sdk/ndk-bundle-r15c/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_ARMV7 -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -I/usr/local/lib/haxe/lib/hxcpp/4,0,4/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow -D_LINUX_STDDEF_H -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV7 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=14 -Wa,--noexecstack -O2 -DNDEBUG -c ... tags=[haxe,static] - src/lime/utils/AssetCache.cpp [haxe,release] Link: libApplicationMain-v7.so Downloading http://services.gradle.org/distributions/gradle-2.10-bin.zip .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. Unzipping /Users/Joncom/.gradle/wrapper/dists/gradle-2.10-bin/2v0chm5oshw52qn5d7jjz7lo0/gradle-2.10-bin.zip to /Users/Joncom/.gradle/wrapper/dists/gradle-2.10-bin/2v0chm5oshw52qn5d7jjz7lo0 Set executable permissions for: /Users/Joncom/.gradle/wrapper/dists/gradle-2.10-bin/2v0chm5oshw52qn5d7jjz7lo0/gradle-2.10/bin/gradle FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > failed to find target with hash string 'android-26' in: /Users/Joncom/Library/Android/sdk * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 1 mins 27.682 secs

There's actually two problems here. The first thing I noticed was that it was telling me to Set executable permissions for the gradle binary it just downloaded/unzipped. I figured I might just need to re-run the command with sudo.

sudo lime build android

Yep. That did it! :)

However, the build still failed, still complaining about:

failed to find target with hash string 'android-26'

Opening "Android Studio", and navigating to Tools > SDK Manager, and installing SDK 26 resolved this issue, and finally build was successful.

Thanks to @dean, @Gama11, and @NotBilly (in HaxeFlixel Discord channel) for helping me through this.