Hi there.
I installed the NDK, SDK, Ant, and had a jdk (1.8) floating around. ‘openfl setup android’ didn’t give me any errors. However, when I compile for android in FlashDevelop, it says:
'arm-linux-androideabi-g++' is not recognized as an internal or external command,
operable program or batch file.
Error: Could not create PCH
Build halted with errors.
a search for ‘arm-linux-androideabi’ returns a file with lots of .o files, but nothing mentioning g++. By the way, my C++ compiler is MinGW, and of course doesn’t mention linux or android. I also tried compiling with ‘openfl build android’, but it gave me the first result. So after lots of online searching, I tried to compile my project on the command line using ‘lime build android -emulator’.
Creating C:/Users....../__pch/haxe/hxcpp.h.gch...
C:/HaxeToolkit......./hxcpp/3,4,2/include/hxcpp.h:19:23: fatal error: typeinfo: No such file or directory
#include <typeinfo>
^
compilation terminated
Error: Could not create PCH
I run in the same problem. Try to find solution (I read almost all posts about this issue ) to compile it to Android but without success. I’m not sure where to start? I will really appreciate if someone can guide us to find solution for this problem. Thanks.
Alright, I installed Gradle and it appears to be working. I downloaded the API 25 (I had API 19 installed before), but I still get the same errors.
On a different note, I found another installation of the SDK and NDK in my program files. ‘arm-linux-androidebi-g++.exe’ is there, hopefully where it’s supposed to be. I DID run ‘openfl setup android’ and changed the paths, but I STILL get the error that the file isn’t found.
Double check that you don’t have a “C:\Users(Your User Name).hxcpp_config.xml” file with different values for the Android NDK than your “C:\Users(Your User Name).lime\config.xml”
If HXCPP sees a different value (Lime should forward it’s values to HXCPP if it doesn’t have it’s own define there) then it could break on the build step
OK, I solve problem by downloading new version of Android NDK (android-ndk-r13b) from official site. Update lime paths and that is it. Successful build and run on android.
Hi, i have a similar problem because i trying to update the sdk ndk and java like lime told… i install all from the android studio and put the respective path for each one of them and i already look into the file .hxcpp_config.xml and change the folders too … i dont now what to do… i am getting this error with a example of openfl:
Note: lime config is another way to edit your ~/.lime/config.xml file
# Print your current config file
lime config
# Print a current config variable
lime config ANDROID_NDK_ROOT
# Set the value of a config variable
lime config ANDROID_NDK_ROOT C:\Development\Android\android-ndk-r15c
# Automate walking through config variables related to Android
lime setup android
EDIT: If ~/.hxcpp_config.xml has ANDROID_NDK_ROOT, it takes preference at the C++ compilation stage, so either you need to remove it from that file, or make sure it reflects the correct NDK value, like your Lime config file
Hello,
i am having a similar issue.
when runninh openfl test android
im am getting sh: arm-linux-androideabi-g++: command not found **Error:** **Could not create PCH**
my ndk is v20
all the paths in the configs are correct.
Any ideas?
HXCPP currently expects a GCC toolchain which was removed from the newer NDKs. I tried adding clang support but it needs a little bit more work before it will work https://github.com/HaxeFoundation/hxcpp/pull/707