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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Burst Compiler causes Android Project to fail to build

Discussion in 'Editor & General Support' started by DiegoAtravesar, Apr 24, 2023.

  1. DiegoAtravesar

    DiegoAtravesar

    Joined:
    Dec 31, 2017
    Posts:
    1
    As it says in the title, trying to build my project for Android with the Burst Compiler enabled causes the build to fail. It builds with no issues with Burst Compiler turned off. I specifically get two errors:

    Error 1
    Code (CSharp):
    1. Library/Bee/artifacts/Android/AsyncPluginsFromLinker: Burst internal compiler error: Burst.Compiler.IL.Aot.AotLinkerException: Non 0 exit code | The native link step failed. Check previous exception in the log - linker command line : "/home/production/Unity/Hub/Editor/2022.2.12f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang '@/tmp/tmp346af7cf.tmp'"
    2. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /home/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
    3.  
    Error 2:
    Code (CSharp):
    1. Building Library/Bee/artifacts/Android/AsyncPluginsFromLinker failed with output:
    2. UnityEditor.Build.BuildFailedException: Burst compiler (1.8.3) failed running
    3.  
    4. stdout:
    5. Starting 1 library requests
    6. Error: Burst internal compiler error: Burst.Compiler.IL.Aot.AotLinkerException: Non 0 exit code | The native link step failed. Check previous exception in the log - linker command line : "/home/production/Unity/Hub/Editor/2022.2.12f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang '@/tmp/tmp346af7cf.tmp'"
    I have tried manually running the linker command line as it says, however I get an error stating it cannot find clang-12, although i have confirmed that clang-12 exists in the directory the cland command is being run from.

    I have confirmed that the paths are correct for the various Android builds tools as seen in in the following image:


    The project is currently using Mono as the Scripting Backend which was the default, I did try changing that to IL2CPP but that resulted in a ton more errors so thats a different problem for a different time.

    At this point my main question is this:

    What do I need to do to get Burst Compiler working for my android build? This occurs across multiple projects on my machine after a relatively new install (few weeks ago) but wasn't the case before. Not sure if there is some dependency outside of Unity that needs to be dealt with or if there is some configuration within Unity that needs changing, but any help in resolving this issue would be greatly appreciated.
     
  2. ALherbier

    ALherbier

    Joined:
    Sep 1, 2020
    Posts:
    8
    I had the same problem (after an update from 2021 to 2022.3) and I have followed the advice from this thread https://forum.unity.com/threads/errors-when-compiling.1457233/
    Change scripting backend from mono to il2cpp (project settings / player / Other settings / Configuration)
    Then another error appear saying than clang was not found but again I followed the advice of ifilatov on this thread
    https://forum.unity.com/threads/build-failure-on-android-unity-2022-2-0b14.1359823/
    and his fix script did work !!
    Hope this can help