Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Exception: Unity.IL2CPP.Building.BuilderFailedException

Discussion in 'Scripting' started by ruui3d, May 31, 2023.

  1. ruui3d

    ruui3d

    Joined:
    Nov 10, 2021
    Posts:
    6
    Hi,

    I have with some problems when I build for Android and IOS wi IL2CPP. If I play on editor i have no errors... I used that before in this project and I never had problems, but I added some dlls for azure integration, and now I have this error:


    Code (CSharp):
    1.  
    2. Exception: Unity.IL2CPP.Building.BuilderFailedException: ...\Editor\2020.3.22f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"...AppData\Local\Temp\tmp2ED6.tmp" -o "...\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_E82DC2553195DD9A71C429B246BD373D\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id -stdlib=libc++ -static-libstdc++ -target aarch64-linux-android21 -Wl,--wrap,sigaction "...\2020.3.22f1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\StaticLibs\arm64-v8a\baselib.a" -llog -rdynamic -fuse-ld=bfd.exe
    3. .../Library/il2cpp_android_arm64-v8a/il2cpp_cache/EE3E2D3E9BFAEB4F840838909AB38E92.o: In function `AbstractApplicationBuilder_1_WithHttpClientFactory_m645A28410EF7E041E83BAEDA249292E663E327FB(AbstractApplicationBuilder_1_t7CECB44A360AF04F0BA7623592085FB8CDEFF225*, Il2CppObject*, MethodInfo const*)':
    4. ...\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput/Azure.Identity.cpp:33366: undefined reference to `AbstractApplicationBuilder_1_WithHttpClientFactory_m212AA9EE3C63D00F2C251C3BC27F93C03ED05759_gshared'
    5. .../Library/il2cpp_android_arm64-v8a/il2cpp_cache/EE3E2D3E9BFAEB4F840838909AB38E92.o: In function `AbstractApplicationBuilder_1_WithLogging_mCB2B78FFE75D3F24BA01330F52B898CC02EAF2A8(AbstractApplicationBuilder_1_t7CECB44A360AF04F0BA7623592085FB8CDEFF225*, LogCallback_tBA28C70AAEEDD785799CF3188EACDF2A0D0DB036*, Nullable_1_t6E25132F0ECB5558311CD43DDD0EFD06E31774B3, Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3, Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3, MethodInfo const*)':
    6. ...\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput/Azure.Identity.cpp:33378: undefined reference to `AbstractApplicationBuilder_1_WithLogging_m0B7FC65CCA4FC1B8CB389E65F283A45A95C0CB75_gshared'
    7. .../Library/il2cpp_android_arm64-v8a/il2cpp_cache/DA4987ED8465C80C0B4A9AB18BCF918F.o: In function `AbstractApplicationBuilder_1_WithHttpClientFactory_m9D8A345F8B5AD278921C094D5C3EF5DEC0F43CD3(AbstractApplicationBuilder_1_tC792A54926D4E2ED7B9B1CB5C1AAADB9A7D281DC*, Il2CppObject*, MethodInfo const*)':
    8. ...\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput/Azure.Identity1.cpp:30657: undefined reference to `AbstractApplicationBuilder_1_WithHttpClientFactory_m212AA9EE3C63D00F2C251C3BC27F93C03ED05759_gshared'
    9. .../Library/il2cpp_android_arm64-v8a/il2cpp_cache/DA4987ED8465C80C0B4A9AB18BCF918F.o: In function `AbstractApplicationBuilder_1_WithLogging_mF926B941DC6EFB2FF3F7F2E6A5C9F34CC5FA71FE(AbstractApplicationBuilder_1_tC792A54926D4E2ED7B9B1CB5C1AAADB9A7D281DC*, LogCallback_tBA28C70AAEEDD785799CF3188EACDF2A0D0DB036*, Nullable_1_t6E25132F0ECB5558311CD43DDD0EFD06E31774B3, Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3, Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3, MethodInfo const*)':
    10. ...\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput/Azure.Identity1.cpp:30669: undefined reference to `AbstractApplicationBuilder_1_WithLogging_m0B7FC65CCA4FC1B8CB389E65F283A45A95C0CB75_gshared'
    11. .../Library/il2cpp_android_arm64-v8a/il2cpp_cache/7168D083EFB8F38C7A0FB1D0B124A910.o:(.data.rel.ro.g_Il2CppGenericMethodPointers+0x3288): undefined reference to `AbstractApplicationBuilder_1_WithHttpClientFactory_m212AA9EE3C63D00F2C251C3BC27F93C03ED05759_gshared'
    12. .../Library/il2cpp_android_arm64-v8a/il2cpp_cache/7168D083EFB8F38C7A0FB1D0B124A910.o:(.data.rel.ro.g_Il2CppGenericMethodPointers+0x3298): undefined reference to `AbstractApplicationBuilder_1_WithLogging_m0B7FC65CCA4FC1B8CB389E65F283A45A95C0CB75_gshared'
    13. clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
    14.    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    15.    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    16.    at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
    17.    at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
    18. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    19. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    20. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    21. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    22. UnityEditorInternal.IL2CPPBuilder.Run () (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    23. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    24. UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <98555a6f2f85454997d71788c5709a62>:0)
    25. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <98555a6f2f85454997d71788c5709a62>:0)
    26. UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <98555a6f2f85454997d71788c5709a62>:0)
    27. UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <98555a6f2f85454997d71788c5709a62>:0)
    28. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2cd7ebc9c2ef4276a8edbc7de85c89ce>:0)
    29. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    30.  
    31.  

    Anyone had this problem?

    Thank you
     
    Last edited: May 31, 2023
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    These errors like like they are either a bug in IL2CPP or some invalid IL code in those new Azure DLLs. I can't quite tell which though. Can I isolate the problem to one or a few new DLLs? If so, maybe submitting a bug report with a project that causes this issue will be the best option. We would love to investigate it.

    https://unity.com/releases/editor/qa/bug-reporting
     
  3. ruui3d

    ruui3d

    Joined:
    Nov 10, 2021
    Posts:
    6
    Thank you, I have follow some steps that I find here, and now I have this:

    Code (CSharp):
    1.  
    2. System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
    3.    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    4.    at System.Diagnostics.Process.Start()
    5.    at Unity.IL2CPP.Shell.SetupAndStart(ExecuteContext context, Boolean asyncMode)
    6.    at Unity.IL2CPP.Shell.ExecuteAsync(ExecuteArgs executeArgs, IExecuteController controller, Boolean asyncMode)
    7.    at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    8.    at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    9.    at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)
    10.  
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    This looks like a pretty different error. This means that the C++ compiler installation cannot be located. If you are building for Android in this case, is the NDK path set up correctly in the Unity editor.
     
  5. ruui3d

    ruui3d

    Joined:
    Nov 10, 2021
    Posts:
    6
    Yes, I solve that problem but it return to the first one.
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Great! Please submit a bug report if you can.
     
  7. NhamPD

    NhamPD

    Joined:
    Nov 11, 2016
    Posts:
    3
    Targets (left menu, mid) > Unity Framework > Build Settings > Other Linker Flags (you can search for it) > double click on value + hit plus on button > add "-ld64" > hit Enter > pray to God and be thankful