- Home /
Failed export android project with il2cpp.
Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput\Il2CppTypeDefinitions.cpp:1: In file included from C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\libil2cpp\il2cpp-config.h:5: C:\Android\sdk\ndk-bundle_r10e\platforms\android-9\arch-arm/usr/include\stdlib.h:43:10: fatal error: 'memory.h' file not found #include ^ 1 error generated.
Here is the log:
Failed running C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --enable-symbol-loading --development-mode --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="E:[project name]\Temp/StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="E:[project name]\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity_5.5.1f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity_5.5.1f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Android/sdk/ndk-bundle_r10e" --map-file-parser="C:\Program Files\Unity_5.5.1f1\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --extra-types.file="C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\il2cpp_default_extra_types.txt" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\Assembly-UnityScript.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.UI.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\DOTween.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\BestHTTP.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\mscorlib.dll" --assembly="E:[project name]\Temp\StagingArea\assets\bin\Data\Managed\System.dll" --generatedcppdir="E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput"
stdout: Building libil2cpp.so with AndroidToolChain. Output directory: E:[project name]\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a Cache directory: E:[project name]\Library\il2cpp_android_armeabi-v7a\il2cpp_cache il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput\Il2CppTypeDefinitions.cpp:1: In file included from C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\libil2cpp\il2cpp-config.h:5: C:\Android\sdk\ndk-bundle_r10e\platforms\android-9\arch-arm/usr/include\stdlib.h:43:10: fatal error: 'memory.h' file not found #include ^ 1 error generated.
Invocation was: Executable: "C:\Android\sdk\ndk-bundle_r10e\toolchains\llvm-3.6\prebuilt\windows-x86_64\bin\clang++" Arguments: -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\bdwgc\include" -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\libil2cpp\include" -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\external\boehmgc\include" -I"E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput" -I"." -I"C:\Android\sdk\ndk-bundle_r10e\sources\cxx-stl\gnu-libstdc++\4.9\include" -I"C:\Android\sdk\ndk-bundle_r10e\sources\cxx-stl\gnu-libstdc++\4.9\include\backward" -I"C:\Android\sdk\ndk-bundle_r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include" -c -g -DNDEBUG -funwind-tables -fno-limit-debug-info -fPIC -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++11 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -Os --sysroot "C:\Android\sdk\ndk-bundle_r10e\platforms\android-9\arch-arm" -gcc-toolchain "C:\Android\sdk\ndk-bundle_r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -mfpu=neon "E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput\Il2CppTypeDefinitions.cpp" -o "E:[project name]\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\572F3EE51A7645B0959E0ABC1303156F.o"
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile) at Unity.IL2CPP.Building.CppProgramBuilder.Build() at il2cpp.Program.DoRun(String[] args) at il2cpp.Program.Run(String[] args) at il2cpp.Program.Main(String[] args) stderr:
Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput\Il2CppTypeDefinitions.cpp:1: In file included from C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\libil2cpp\il2cpp-config.h:5: C:\Android\sdk\ndk-bundle_r10e\platforms\android-9\arch-arm/usr/include\stdlib.h:43:10: fatal error: 'memory.h' file not found #include ^ 1 error generated.
Invocation was: Executable: "C:\Android\sdk\ndk-bundle_r10e\toolchains\llvm-3.6\prebuilt\windows-x86_64\bin\clang++" Arguments: -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\bdwgc\include" -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\libil2cpp\include" -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\external\boehmgc\include" -I"E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput" -I"." -I"C:\Android\sdk\ndk-bundle_r10e\sources\cxx-stl\gnu-libstdc++\4.9\include" -I"C:\Android\sdk\ndk-bundle_r10e\sources\cxx-stl\gnu-libstdc++\4.9\include\backward" -I"C:\Android\sdk\ndk-bundle_r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include" -c -g -DNDEBUG -funwind-tables -fno-limit-debug-info -fPIC -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++11 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -Os --sysroot "C:\Android\sdk\ndk-bundle_r10e\platforms\android-9\arch-arm" -gcc-toolchain "C:\Android\sdk\ndk-bundle_r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -mfpu=neon "E:[project name]\Temp\StagingArea\Il2Cpp\il2cppOutput\Il2CppTypeDefinitions.cpp" -o "E:[project name]\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\572F3EE51A7645B0959E0ABC1303156F.o"
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile) at Unity.IL2CPP.Building.CppProgramBuilder.Build() at il2cpp.Program.DoRun(String[] args) at il2cpp.Program.Run(String[] args) at il2cpp.Program.Main(String[] args)
UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:96) UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:298) UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:289) UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:131) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:32) UnityEditor.HostView:OnGUI()
Answer by JoshPeterson · Apr 03, 2017 at 12:17 PM
It looks like the Android NDK installation might be incorrect on this machine:
In file included from C:\Program Files\Unity_5.5.1f1\Editor\Data\il2cpp\libil2cpp\il2cpp-config.h:5: C:\Android\sdk\ndk-bundle_r10e\platforms\android-9\arch-arm/usr/include\stdlib.h:43:10: fatal error: 'memory.h' file not found
Certainly, memory.h should exist. Can you attempt to update or re-install the NDK?