Tag Archives: Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe

[Solved] Unity Package Error: Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe

Today, I tried to access the company’s overseas SDK. The total package error is as follows:

Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="E:\TombNote_tChinese_test\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="E:\TombNote_tChinese_test\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="D:\Program Files\Unity2018.4.1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="D:\Program Files\Unity2018.4.1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="E:/AndroidSDK/NDK" --map-file-parser="D:\Program Files\Unity2018.4.1\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --directory="E:\TombNote_tChinese_test\Temp\StagingArea\assets\bin\Data\Managed" --generatedcppdir="E:\TombNote_tChinese_test\Temp\StagingArea\Il2Cpp\il2cppOutput"

stdout:
Building libil2cpp.so with AndroidToolChain
    Output directory: E:\TombNote_tChinese_test\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
    Cache directory: E:\TombNote_tChinese_test\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
ObjectFiles: 603 of which compiled: 0
Total compilation time: 242 milliseconds.
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: E:\AndroidSDK\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\RFL\AppData\Local\Temp\tmp80DF.tmp" -o "E:\TombNote_tChinese_test\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_EC005744B79151E709C4C1D5591AE889\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "E:\AndroidSDK\NDK\platforms\android-16\arch-arm" -gcc-toolchain "E:\AndroidSDK\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "E:\AndroidSDK\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -llog -rdynamic -fuse-ld=gold.exe

E:\TombNote_tChinese_test\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Assembly-CSharp_2.cpp:43762: error: undefined reference to 'CallSDKFunc'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

Results the data was checked because [dllimport (“_internal”)]
of OS cannot exist when Android is typed.

Solution:
find [dllimport (“_internal”)]
Add judgment platform in the code

#if UNITY_ IOS
[DllImport(“__Internal”)]
#endif