Problem with building the android export templates

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Little_Deer
:warning: Old Version Published before Godot 3 was released.

I’ve tried to compile the library to use AdMob in my android game, but scons says that included file alloca.h is missing and stops the process. I’ve read the manual and installed all necessary tools, but the error is still here. Does anybody know how to fix that?

c:\godot>scons platform=android target=release
scons: Reading SConscript files ...

MSVC not detected, attempting Mingw.
- gcc detected.
Godot Android!!!!! (armv7) (with neon)
scons: done reading SConscript files.
scons: Building targets ...
c:\Users\Little_Deer\AppData\Local\Android\Sdk\ndk-bundle\/toolchains/llvm/prebu
ilt/windows-x86_64/bin/clang++ -o platform\android\os_android.os -c -fno-rtti -f
no-exceptions -DNO_SAFE_CAST -Wall -DNDEBUG -DFREETYPE_ENABLED -DENABLE_DEPRECAT
ED -isystem c:\Users\Little_Deer\AppData\Local\Android\Sdk\ndk-bundle\/platforms
/android-14/arch-arm/usr/include -fpic -ffunction-sections -funwind-tables -fsta
ck-protector-strong -fvisibility=hidden -fno-strict-aliasing -DANDROID -DNO_STAT
VFS -DGLES2_ENABLED -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-ab
i=softfp -mfpu=neon -D__ARM_NEON__ -target armv7-none-linux-androideabi -fno-int
egrated-as -gcc-toolchain c:\Users\Little_Deer\AppData\Local\Android\Sdk\ndk-bun
dle\/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -O2 -DNDEBUG -
ffast-math -funsafe-math-optimizations -fomit-frame-pointer -ftree-vectorize -DA
NDROID_ENABLED -DUNIX_ENABLED -DNO_FCNTL -DMPC_FIXED_POINT -DGDSCRIPT_ENABLED -D
MINIZIP_ENABLED -DXML_ENABLED -Icore -Icore\math -Ieditor -Idrivers -I. -Iplatfo
rm\android -Ithirdparty\zlib -Ithirdparty\freetype -Ithirdparty\freetype\include
 -Ithirdparty\libpng platform\android\os_android.cpp
=====
In file included from platform\android\os_android.cpp:30:
In file included from platform\android/os_android.h:33:
In file included from .\drivers/unix/os_unix.h:39:
In file included from .\drivers/unix/ip_unix.h:33:
In file included from core\io/ip.h:33:
In file included from core\io/ip_address.h:33:
In file included from core\ustring.h:33:
In file included from core/array.h:33:
In file included from core/typedefs.h:38:
platform\android\platform_config.h:30:10: fatal error: 'alloca.h' file not found

#include <alloca.h>
         ^~~~~~~~~~
1 error generated.

=====
scons: *** [platform\android\os_android.os] Error 1
scons: building terminated because of errors.

I think godot need explain more the export template

Godot 3, where the ios export xcode project

There no docs to how build godot 3 game on ios,.??

Best regards

xCode Soul | 2018-01-09 04:47

your ndk version?
try with latest ndk.

volzhs | 2018-01-09 06:35

I’ve already updated NDK to the latest version. Actually those .h files scons can’t find are in the NDK folder, but for some reason scons can’t reach them.

Little_Deer | 2018-01-09 12:29

:bust_in_silhouette: Reply From: Little_Deer

So the problem really was with the NDK. Google changed the header folder in later versions of NDK!
So for anyone building the android export templates: USE NDK 13b, otherwise scons never find the headers!

Compiling using the Android NDK r16b with the latest Android SDK on Linux works for me.

Calinou | 2018-01-15 00:49

What’s your version of Godot?

Little_Deer | 2018-01-16 15:59