- Home /
I have the following error when trying to compile in Il2cpp...
I have the following error when trying to compile in Il2cpp
Failed running C:\Program Files\Unity\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="D:\Client\trunk\RGame\Temp/StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="D:\Client\trunk\RGame\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Users/Developer-GameBear/AppData/Local/Android/sdk-unity/ndk-bundle" --map-file-parser="C:\Program Files\Unity\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp-firstpass.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Assembly-UnityScript.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.UI.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Analytics.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\DOTween.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Facebook.Unity.Settings.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\UI_SpriteAsset.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Facebook.Unity.Android.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Facebook.Unity.IOS.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Firebase.App.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Mono.Security.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\mscorlib.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\Stores.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\System.Core.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\System.dll" --assembly="D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Purchasing.dll" --generatedcppdir="D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput"
stdout: Building libil2cpp.so with AndroidToolChain. Output directory: D:\Client\trunk\RGame\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a Cache directory: D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache ObjectFiles: 612 of which compiled: 0 Total compilation time: 680 milliseconds. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Users\Developer-GameBear\AppData\Local\Android\sdk-unity\ndk-bundle\toolchains\llvm-3.6\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\Developer-GameBear\AppData\Local\Temp\tmpF06.tmp" -o "D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_06C30BE19AE5890DD354C27780632DA1\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "C:\Users\Developer-GameBear\AppData\Local\Android\sdk-unity\ndk-bundle\platforms\android-16\arch-arm" -gcc-toolchain "C:\Users\Developer-GameBear\AppData\Local\Android\sdk-unity\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "C:\Users\Developer-GameBear\AppData\Local\Android\sdk-unity\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -Xlinker -Map="D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_06C30BE19AE5890DD354C27780632DA1\libil2cpp.map" -fuse-ld=bfd
D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_init_m632610565': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6567: undefined reference to init' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_logout_m1517745172': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6595: undefined reference to logout' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_activateApp_m486839488': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6605: undefined reference to activateApp' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_logPurchase_m2381031734': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6629: undefined reference to logPurchase' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_ui_m3813026227': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6659: undefined reference to ui' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_initScreenPosition_m2309792883': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6681: undefined reference to initScreenPosition' D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6681: undefined reference to initScreenPosition' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_logout_m1517745172': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6595: undefined reference to logout' D:\Client\trunk\RGame\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\B41FC0C272C213A51F258B693527354D.o: In function CanvasFacebook_activateApp_m486839488': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6605: undefined reference to `activateApp' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
Answer by Darioszka · May 28, 2019 at 07:59 AM
I'm not sure if I remember correctly but I think I downloaded another Ndk (remove the path in Unity to ndk and during build select the option to find the right version on the Internet itself)
Answer by JoshPeterson · May 28, 2019 at 01:19 PM
It looks like the relevant error message is:
In function CanvasFacebook_init_m632610565': D:\Client\trunk\RGame\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Facebook.Unity_0.cpp:6567: undefined reference to init'
This usually indicates there is managed code (C#) in the project in an assembly named Facebook.Unity.dll which has a extern method named init
in a class named CanvasFacebook
. This extern method must have a native method of the same name ("init") available in the build process. It looks like this method is not available. Should there be a corresponding native library in the build?