COMMUNITY

Haxelib run flow build android


(Alexandr Korsak) #1

Hi everyone!

Command that used to build android version of the project haxelib run flow build android

Using luxe(master), hxcpp(master).

issue:

flow / 1.0.0-alpha.2 (node.js v0.12.7)
flow / target is android ( arch armv7 )
flow / build only
flow / haxe version 3.4.7

flow / build - tetris 0.0.1 for android
flow / snow - android project - exists at `/Users/akorsak/projects/games/haxe/platformer/android.project`

flow / build - running haxe ...
flow / build - running hxcpp for arch armv7 ...
17
17
Creating /Users/akorsak/projects/games/haxe/platformer/bin/android.build/cpp/obj/android-v7/__pch/haxe/hxcpp.h.gch...
In file included from /Users/akorsak/Library/Android/sdk//android-ndk-r17c/sources/cxx-stl/gnu-libstdc++/4.9/include/typeinfo:34:0,
                 from /usr/local/Cellar/haxe/3.4.7/lib/haxe/lib/hxcpp/git/include/hxcpp.h:19:
/Users/akorsak/Library/Android/sdk//android-ndk-r17c/sources/cxx-stl/gnu-libstdc++/4.9/include/exception:37:28: fatal error: bits/c++config.h: No such file or directory
 #include <bits/c++config.h>
                            ^
compilation terminated.
Error: Could not create PCH

Did someone have the similar issue on building android project?

Thank you!

Best Regards,
Alexandr.


#2

Hi Alex, did you have any luck solving it? I’m also running into the same error, but through openFL’s openfl build android (using Haxe 3.4.7 and OpenFL 8.2.2):

Creating PCH directory "/Volumes/SecondarySSD/dev/zz-openfl/Export/android/obj/obj/android-v7/__pch/haxe"
 - Precompile /Volumes/SecondarySSD/dev/zz-openfl/Export/android/obj/obj/android-v7/__pch/haxe/hxcpp.h.gch
 - Running command: arm-linux-androideabi-g++ -Iinclude --sysroot=/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/platforms/android-14/arch-arm -I/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -I/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=331 -I/Users/xiaodili/haxelib/hxcpp/3,4,188/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 -Wno-invalid-offsetof -frtti -std=c++11 -o /Volumes/SecondarySSD/dev/zz-openfl/Export/android/obj/obj/android-v7/__pch/haxe/hxcpp.h.gch /Users/xiaodili/haxelib/hxcpp/3,4,188/include/hxcpp.h
In file included from /Volumes/SecondarySSD/library/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/typeinfo:34:0,
                 from /Users/xiaodili/haxelib/hxcpp/3,4,188/include/hxcpp.h:19:
/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/exception:37:28: fatal error: bits/c++config.h: No such file or directory
 #include <bits/c++config.h>
                            ^
compilation terminated.
Error: Error while running command
arm-linux-androideabi-g++ -Iinclude --sysroot=/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/platforms/android-14/arch-arm -I/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -I/Volumes/SecondarySSD/library/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=331 -I/Users/xiaodili/haxelib/hxcpp/3,4,188/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 -Wno-invalid-offsetof -frtti -std=c++11 -o /Volumes/SecondarySSD/dev/zz-openfl/Export/android/obj/obj/android-v7/__pch/haxe/hxcpp.h.gch /Users/xiaodili/haxelib/hxcpp/3,4,188/include/hxcpp.h

Update: I did a bit more poking around and came across this SO answer which fixed my issue (downgrade to Java 8):


(Alexandr Korsak) #3

Hi

it didn’t help me, I have installed java 8. I moved away of luxe because of hard to find the issue compilation process.

Now I’ve just started to use Gecko2D. it looks ok on building the projects. :slight_smile:

Alex.


('Damilare Darmie Akinlaja) #4

you need to downgrade your Android NDK to at least version r10b .