fatal error: 'kernel.h' file not found

,

HI,

I am using Android to Build for Meta Quest 2. However when I convert my project over to IL2CPP so I can export as Arm64

I get the following error on build

##### CommandLine
"C:/Program Files/Unity/Hub/Editor/2022.2.12f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++" -march=armv8-a -D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -faddrsig -mllvm -hoist-common-insts=1 -DANDROID -DHAVE_INTTYPES_H -no-canonical-prefixes -funwind-tables -fstack-protector -fomit-frame-pointer -std=c++11 -Wswitch -Wno-trigraphs -Wno-tautological-compare -Wno-invalid-offsetof -Wno-implicitly-unsigned-literal -Wno-integer-overflow -Wno-shift-negative-value -Wno-unknown-attributes -Wno-implicit-function-declaration -Wno-null-conversion -Wno-missing-declarations -Wno-unused-value -Wno-pragma-once-outside-header -fvisibility=hidden -fexceptions -fno-rtti -g -Os -fPIC -fno-strict-overflow -ffunction-sections -fdata-sections -fmessage-length=0 -pipe -D_GLIBCXX_USE_CXX11_ABI=0 -DBASELIB_INLINE_NAMESPACE=il2cpp_baselib -DIL2CPP_MONO_DEBUGGER_DISABLED -DRUNTIME_IL2CPP -DTARGET_ARM64 -DIL2CPP_ENABLE_WRITE_BARRIERS=1 -DIL2CPP_INCREMENTAL_TIME_SLICE=3 -DHAVE_BDWGC_GC -DNDEBUG -I"." -I"X:/UGVR/UGVR/Library/Bee/artifacts/Android/il2cppOutput/cpp" -I"C:/Program Files/Unity/Hub/Editor/2022.2.12f1/Editor/Data/il2cpp/libil2cpp/pch" -I"C:/Program Files/Unity/Hub/Editor/2022.2.12f1/Editor/Data/il2cpp/libil2cpp" -I"C:/Program Files/Unity/Hub/Editor/2022.2.12f1/Editor/Data/il2cpp/external/baselib/Include" -I"C:/Program Files/Unity/Hub/Editor/2022.2.12f1/Editor/Data/il2cpp/libil2cpp/os/ClassLibraryPAL/brotli/include" -I"C:/Program Files/Unity/Hub/Editor/2022.2.12f1/Editor/Data/il2cpp/external/baselib/Platforms/Android/Include" -o "Library/Bee/artifacts/Android/d8kzr/7aqc_prx.o" -fcolor-diagnostics -fdiagnostics-absolute-paths -target aarch64-linux-android22 -fstrict-aliasing -fdiagnostics-format=msvc -c -x c++ "X:/UGVR/UGVR/Library/Bee/artifacts/Android/il2cppOutput/cpp/prx.cpp"
##### ExitCode
1
##### Output
X:\UGVR\UGVR\Library\Bee\artifacts\Android\il2cppOutput\cpp\prx.cpp(2,10): **fatal error: 'kernel.h' file not found**

#include <kernel.h>

^~~~~~~~~~

1 error generated.
*** Tundra build failed (34.79 seconds), 183 items updated, 2810 evaluated
Building Library\Bee\artifacts\Android\d8kzr\7aqc_prx.o failed with output:
X:\UGVR\UGVR\Library\Bee\artifacts\Android\il2cppOutput\cpp\prx.cpp(2,10): fatal error: 'kernel.h' file not found
#include <kernel.h>
^~~~~~~~~~
1 error generated.

I have tried a lot of approaches to try an resolve this and am at wits end. What is kernel.h and why am I for some reason now missing it?

I’m not entirely sure what prx.cpp is. I don’t think that is a file Unity ships or generates. Is there a prx.cpp file somewhere in the project? The Unity build system for IL2CPP will try to compile “loose” .cpp files like this, assuming they are required for C#/C++ interop.

That file might be incorrectly getting picked up by the build system.

Yes! Found it. the prx.cpp was not excluded from Android. Thanks

1 Like