Android libil2cpp.so over 200MB and cause compiler error
the compiler error is
/Volumes/Android/buildbot/src/android/ndk-release-r19/external/libcxx/src/locale.cpp:468:(.text._ZNSt6__ndk16locale5__imp7installINS_14codecvt_bynameIDic9mbstate_tEEEEvPT_[_ZNSt6__ndk16locale5__imp7installINS_14codecvt_bynameIDic9mbstate_tEEEEvPT_]+0xdc): additional relocation overflows omitted from the output
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
at il2cpp.Program.Main(String[] args)
at Program.Main(String[] args) in /Users/bokken/buildslave/unity/build/External/il2cpp/il2cpp/il2cppcore/Program.cs:line 24
at UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) [0x000e3] in
I dump an old version libil2cpp.so (50MB) functions. compare to the new dump: most differences are these "mono_xxxx" functions.
Is there some way to find out why these functions be linked in my libil2cpp?
I build the project on Unity Version 2019.4.14f1 and 2019.4.31f1
I tried :
Clean Library and Temp directory
Delete some unnecessary C# code until compile succeed,and dump these functions.
Answer by JoshPeterson · Nov 10, 2021 at 11:41 AM
The new functions are referenced because script debugging is enabled. When it is enabled, the code size will grow, which can lead to problems for the native linker in the Android NDK.
Your answer
Follow this Question
Related Questions
Problem with Unity 2018.4.24 on Big Sur 0 Answers
Unable to generate 64 bit android apk for Unity project 0 Answers
Cant build for android 1 Answer
Plugin with id "com.android.application" not found. Gradle Build Failed 1 Answer
Can't Build with IL2CPP for Android after 2018.3.0 Update(Empty Project) 1 Answer