Android build on Windows fail, can't explain why

I’m trying to build for Android under windows - I used to be able to do this without problems and built several openfl applications in the past, but I got a new computer and after setting everything up I just can’t get it to work.

I used openfl setup android to download and install the sdk r22.0.5 (installing Android SDK platform-tools and Android API 16 packages), ndk r8b and Apache Ant 1.9.2. I’m using jdk1.8.0_101.

When I try and build the application, it comes up with several Unknown EABI object attribute 34 errors (they filled my log up) and in the end

C:/HaxeToolkit/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: Warning: C:\HaxeToolkit\android\ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o: Unknown EABI object attribute 44
obj/android-v7/db5b943b_Debug.obj: In function `hx::StackFrame::~StackFrame()':
Debug.cpp:(.text._ZN2hx10StackFrameD2Ev+0x310): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
obj/android-v7/db5b943b_Debug.obj: In function `hx::__hxcpp_register_stack_frame(hx::StackFrame*)':
Debug.cpp:(.text._ZN2hx28__hxcpp_register_stack_frameEPNS_10StackFrameE+0x294): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
collect2: ld returned 1 exit status
Error: error running arm-linux-androideabi-g++ -olibApplicationMain-v7.so -frtti -nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined -Wl,-z,noexecstack --sysroot=C:\HaxeToolkit\android\ndk/platforms/android-9/arch-arm -LC:\HaxeToolkit\android\ndk/platforms/android-9/arch-arm/usr/lib @obj/android-v7/all_objs C:\HaxeToolkit\android\ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/libgnustl_static.a C:\HaxeToolkit\android\ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o C:\HaxeToolkit\android\ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a C:\HaxeToolkit\android\ndk/platforms/android-9/arch-arm/usr/lib/libc.so C:\HaxeToolkit\android\ndk/platforms/android-9/arch-arm/usr/lib/libm.so -llog -ldl

I tried using the newer sdk I’ve got setup for my regular Android development, tried using other version of the ndk after a bit of googling but with no success.

I’m on a Windows 10 x64 machine - that’s the only different thing I can think about from my previous environment (I was on Windows 7).

Any help would be greatly appreciated.

Damn, I hate when I find the fix 5 minutes after writing a forum post.

I forgot to run -clean inbetween builds, so it was always using the broken files from the first build, where I wrongly used the newer ndk-r12b. Clean build works now.

2 Likes

I hate that happening to me too, but fortunately for all of us you came back and followed up with the fix, which should make someone else’s life easier :slight_smile:

1 Like