- Home /
Question by
flyingorcus · Nov 12, 2018 at 03:04 PM ·
android buildil2cpp
IL2CPP Android build failing in Unity 2018.2.4
I am building for Android using IL2CPP but getting an error.
Only thing I am able to understand is the error is in CPP code, with duplicate function declarations.
Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:35: multiple definition of free_gptr_array(GPtrArray*)
Also, I am using Experimental Linux editor. Below I am adding whole stack trace.
Thanks in advance for any help.
Failed running /home/deepankar/Unity/Editor/Data/il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityjit" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Native/armeabi-v7a/libil2cpp.so" --cachedirectory="/home/madhouse/Reine/Assets/../Library/il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="/home/deepankar/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/bdwgc/include" --additional-include-directories="/home/deepankar/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/libil2cpp/include" --tool-chain-path="/home/deepankar/Programs/android-ndk-r13b" --map-file-parser="/home/deepankar/Unity/Editor/Data/Tools/MapFileParser/MapFileParser" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/Assembly-CSharp.dll" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/Unity.RenderPipelines.Core.Runtime.dll" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/Unity.RenderPipelines.Lightweight.Runtime.dll" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/Unity.Postprocessing.Runtime.dll" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/Unity.TextMeshPro.dll" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.UI.dll" --assembly="/home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.dll" --generatedcppdir="/home/madhouse/Reine/Temp/StagingArea/Il2Cpp/il2cppOutput"
stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: /home/madhouse/Reine/Temp/StagingArea/assets/bin/Data/Native/armeabi-v7a
Cache directory: /home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache
ObjectFiles: 591 of which compiled: 192
Time Compile: 559 milliseconds Environment.cpp
Time Compile: 550 milliseconds Il2CppMetadataRegistration.cpp
Time Compile: 511 milliseconds MonoEnumInfo.cpp
Time Compile: 509 milliseconds Normalization.cpp
Time Compile: 499 milliseconds NativeDelegateMethodCache.cpp
Time Compile: 492 milliseconds Activator.cpp
Time Compile: 492 milliseconds Process.cpp
Time Compile: 455 milliseconds PropertyInfo.cpp
Time Compile: 444 milliseconds SemaphoreImpl.cpp
Time Compile: 438 milliseconds EventInfo.cpp
Total compilation time: 10571 milliseconds.
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: /home/deepankar/Programs/android-ndk-r13b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ @"/tmp/tmp42182b5e.tmp" -o "/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/linkresult_E61B20A649CFE02C557E749D3BECFD69/libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "/home/deepankar/Programs/android-ndk-r13b/platforms/android-16/arch-arm" -gcc-toolchain "/home/deepankar/Programs/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "/home/deepankar/Programs/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a" -lgnustl_static -llog -Xlinker -Map="/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/linkresult_E61B20A649CFE02C557E749D3BECFD69/libil2cpp.map" -rdynamic -fuse-ld=bfd
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `free_gptr_array(GPtrArray*)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:35: multiple definition of `free_gptr_array(GPtrArray*)'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:35: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:6: multiple definition of `empty_gptr_array()'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:6: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:6: multiple definition of `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:6: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/1D2D076EE1861F54CB370BAA5B3F9DAA.o: In function `il2cpp::os::Debug::IsDebuggerPresent()':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/os/Debug.cpp:14: multiple definition of `il2cpp::os::Debug::IsDebuggerPresent()'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/ECC6DF2F4560790154C5DC8A8EBE82EB.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/os/Generic/Debug.cpp:14: first defined here
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles (System.Collections.Generic.HashSet`1[T] objectFiles, Unity.IL2CPP.Building.ToolChains.CppToolChainContext toolChainContext) [0x001e5] in <ba170547f5354457b166a91eeab2ddb8>:0
at Unity.IL2CPP.Building.CppProgramBuilder.Build (Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x0023f] in <ba170547f5354457b166a91eeab2ddb8>:0
at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner (Unity.IL2CPP.Building.CppProgramBuilder builder, Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <ba170547f5354457b166a91eeab2ddb8>:0
at il2cpp.Program.DoRun (System.String[] args) [0x00687] in <ed91f4cb3dfc4c70852d8b03a77d76e6>:0
at il2cpp.Program.Run (System.String[] args) [0x00020] in <ed91f4cb3dfc4c70852d8b03a77d76e6>:0
at il2cpp.Program.Main (System.String[] args) [0x00002] in <ed91f4cb3dfc4c70852d8b03a77d76e6>:0
stderr:
Unhandled Exception:
Unity.IL2CPP.Building.BuilderFailedException: /home/deepankar/Programs/android-ndk-r13b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ @"/tmp/tmp42182b5e.tmp" -o "/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/linkresult_E61B20A649CFE02C557E749D3BECFD69/libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "/home/deepankar/Programs/android-ndk-r13b/platforms/android-16/arch-arm" -gcc-toolchain "/home/deepankar/Programs/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "/home/deepankar/Programs/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a" -lgnustl_static -llog -Xlinker -Map="/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/linkresult_E61B20A649CFE02C557E749D3BECFD69/libil2cpp.map" -rdynamic -fuse-ld=bfd
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `free_gptr_array(GPtrArray*)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:35: multiple definition of `free_gptr_array(GPtrArray*)'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:35: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:6: multiple definition of `empty_gptr_array()'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:6: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:6: multiple definition of `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:6: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/1D2D076EE1861F54CB370BAA5B3F9DAA.o: In function `il2cpp::os::Debug::IsDebuggerPresent()':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/os/Debug.cpp:14: multiple definition of `il2cpp::os::Debug::IsDebuggerPresent()'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/ECC6DF2F4560790154C5DC8A8EBE82EB.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/os/Generic/Debug.cpp:14: first defined here
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles (System.Collections.Generic.HashSet`1[T] objectFiles, Unity.IL2CPP.Building.ToolChains.CppToolChainContext toolChainContext) [0x001e5] in <ba170547f5354457b166a91eeab2ddb8>:0
at Unity.IL2CPP.Building.CppProgramBuilder.Build (Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x0023f] in <ba170547f5354457b166a91eeab2ddb8>:0
at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner (Unity.IL2CPP.Building.CppProgramBuilder builder, Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <ba170547f5354457b166a91eeab2ddb8>:0
at il2cpp.Program.DoRun (System.String[] args) [0x00687] in <ed91f4cb3dfc4c70852d8b03a77d76e6>:0
at il2cpp.Program.Run (System.String[] args) [0x00020] in <ed91f4cb3dfc4c70852d8b03a77d76e6>:0
at il2cpp.Program.Main (System.String[] args) [0x00035] in <ed91f4cb3dfc4c70852d8b03a77d76e6>:0
[ERROR] FATAL UNHANDLED EXCEPTION: Unity.IL2CPP.Building.BuilderFailedException: /home/deepankar/Programs/android-ndk-r13b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ @"/tmp/tmp42182b5e.tmp" -o "/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/linkresult_E61B20A649CFE02C557E749D3BECFD69/libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "/home/deepankar/Programs/android-ndk-r13b/platforms/android-16/arch-arm" -gcc-toolchain "/home/deepankar/Programs/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "/home/deepankar/Programs/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a" -lgnustl_static -llog -Xlinker -Map="/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/linkresult_E61B20A649CFE02C557E749D3BECFD69/libil2cpp.map" -rdynamic -fuse-ld=bfd
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `free_gptr_array(GPtrArray*)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:35: multiple definition of `free_gptr_array(GPtrArray*)'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:35: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:6: multiple definition of `empty_gptr_array()'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:6: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/011A102D7CDA0BC09E23311358D99133.o: In function `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/mono-structs.cpp:6: multiple definition of `void_ptr_array_to_gptr_array(il2cpp::utils::dynamic_array<void*, 4u> const&)'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/F069C82D2C5D5F99552331196EB0B0E5.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/utils/mono-structs.cpp:6: first defined here
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/1D2D076EE1861F54CB370BAA5B3F9DAA.o: In function `il2cpp::os::Debug::IsDebuggerPresent()':
/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/os/Debug.cpp:14: multiple definition of `il2cpp::os::Debug::IsDebuggerPresent()'
/home/madhouse/Reine/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/ECC6DF2F4560790154C5DC8A8EBE82EB.o:/home/deepankar/Unity/Editor/Data/il2cpp/libil2cpp/os/Generic/Debug.cpp:14: first defined here
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment
This looks like a bug in Unity. Can you submit a bug report with this project?
Your answer
![](https://koobas.hobune.stream/wayback/20220612181907im_/https://answers.unity.com/themes/thub/images/avi.jpg)