Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Unity2021.2.7f1 with android studio build ndk error

Discussion in 'Android' started by NSWell, Jan 3, 2022.

  1. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    89
    Run on Mac M1 max
    Failed to build Unity2021.2.7f1 android project using Android Studio 2020.3.1


    Code (CSharp):
    1.  
    2. Build failed with 0 successful nodes and 0 failed ones
    3. Error: Internal build system error. BuildProgram exited with code 1.
    4. Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Android, you must have the following NDK version installed:
    5. * Android NDK v21d
    6.  
    7. Unable to detect any compatible Android NDK installation!
    8. * Found Android NDK installation at "/Applications/Unity/Hub/Editor/2021.2.7f1/PlaybackEngines/AndroidPlayer/SDK/ndk/android-ndk-r21d" but building is not supported on this host
    9.  
    10. The correct Android NDK can be installed through Unity Hub.
    11.  
    12.  
    13.    at Unity.IL2CPP.Bee.BuildLogic.Android.AndroidBuildLogic.UserAvailableToolchainFor(Architecture architecture, NPath toolChainPath, NPath sysRootPath) in /Users/bokken/build/output/unity/il2cpp/Bee/Unity.IL2CPP.Bee.BuildLogic.Android/AndroidBuildLogic.cs:line 159
    14.    at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory) in Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.dll:token 0x6000002+0x0
    15.    at il2cpp.Compilation.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Compilation/InProcessBuildProgram.cs:line 51
    16.  
    17.  
    18. Error: Unity.IL2CPP.Building.BuilderFailedException: Build failed with 0 successful nodes and 0 failed ones
    19. Error: Internal build system error. BuildProgram exited with code 1.
    20. Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Android, you must have the following NDK version installed:
    21. * Android NDK v21d
    22.  
    23. Unable to detect any compatible Android NDK installation!
    24. * Found Android NDK installation at "/Applications/Unity/Hub/Editor/2021.2.7f1/PlaybackEngines/AndroidPlayer/SDK/ndk/android-ndk-r21d" but building is not supported on this host
    25.  
    26. The correct Android NDK can be installed through Unity Hub.
    27.  
    28.  
    29.    at Unity.IL2CPP.Bee.BuildLogic.Android.AndroidBuildLogic.UserAvailableToolchainFor(Architecture architecture, NPath toolChainPath, NPath sysRootPath) in /Users/bokken/build/output/unity/il2cpp/Bee/Unity.IL2CPP.Bee.BuildLogic.Android/AndroidBuildLogic.cs:line 159
    30.    at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory) in Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.dll:token 0x6000002+0x0
    31.    at il2cpp.Compilation.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Compilation/InProcessBuildProgram.cs:line 51
    32.  
    33.  
    34.    at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Program.cs:line 331
    Bug report case id: 1392400
     
    Last edited: Jan 4, 2022
  2. jo_cchcc

    jo_cchcc

    Joined:
    Jul 13, 2021
    Posts:
    2
  3. Romixery

    Romixery

    Joined:
    Jan 6, 2019
    Posts:
    1
    Same problem here on M1 Max. Unity 2021.2.7f1
     
  4. Thrawn666

    Thrawn666

    Joined:
    Jan 28, 2013
    Posts:
    2
    Same on M1, Unity 2021.2.8f1.
     
  5. pstpetrov

    pstpetrov

    Joined:
    Aug 5, 2012
    Posts:
    21
    Same on M1, Unity 2021.2.8f1. Tried replacing the NDK folder with a new 21d install and same thing.
     
  6. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    63
    Same problem with M1. Has anyone fixed it?
     
  7. mustafatahatepedelen

    mustafatahatepedelen

    Joined:
    Nov 22, 2020
    Posts:
    2
    Same on M1, tried with Unity 2021.2.12f1.
     
  8. NicolasCaligi

    NicolasCaligi

    Joined:
    Apr 24, 2018
    Posts:
    2
    Same problem on M1 (Unity 2021.2.13f1)
     
  9. gelly9

    gelly9

    Joined:
    Feb 26, 2022
    Posts:
    1
    Same problem on M1 (Unity 2021.2.13f1)
     
  10. guoqiang_yan

    guoqiang_yan

    Joined:
    Apr 1, 2020
    Posts:
    2
    Same problem with M1 pro(Unity 2021.2.14). Has anyone fixed it?
     
  11. Dooood

    Dooood

    Joined:
    Mar 10, 2022
    Posts:
    2
    Same on M1, I tried 2020.3.30f1, 2021.2.16f1, 2022.1.0.b13, every Silicon version have that issue, Intel ones are fine.

    Is there a bug report somewhere we can follow?
     
  12. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    145
    zzzzzz same problem.
     
  13. ryuzaki01

    ryuzaki01

    Joined:
    May 30, 2017
    Posts:
    1
    same here.. any fix ?
     
  14. guoqiang_yan

    guoqiang_yan

    Joined:
    Apr 1, 2020
    Posts:
    2
    Last edited: Apr 8, 2022
  15. mustafatahatepedelen

    mustafatahatepedelen

    Joined:
    Nov 22, 2020
    Posts:
    2
    A few moment later. 2021.2.18f1 same.
     
  16. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    89
    Fixed on Unity 2021.3f1
     
  17. santoshvarma4u

    santoshvarma4u

    Joined:
    Jan 29, 2022
    Posts:
    1
    Same issue in Unity2021.3f1
     
    unity_3BFOedNg3agMhA likes this.
  18. NicolasCaligi

    NicolasCaligi

    Joined:
    Apr 24, 2018
    Posts:
    2
    Same issue in Unity 2021.3.2f1 and Unity 2022.1.0f1 (Silicon version)
     
  19. hualinZhang

    hualinZhang

    Joined:
    Dec 15, 2016
    Posts:
    3
    Same issue in Unity 2021.2.3f1c1 (Silicon version)
     
  20. kakaxixue

    kakaxixue

    Joined:
    Apr 28, 2022
    Posts:
    3
    Same issue in Unity 2021.2.31f1c1 (Silicon version)
     
  21. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
  22. JuanGuzmanH

    JuanGuzmanH

    Joined:
    Feb 8, 2018
    Posts:
    73
    I tried with every version of the hub and 2019 2020 2021 and even the beta of 2022. None of them installs the ndk on my M1 macbook pro. I solved installing jdk and sdk from unity but installing the right version of the ndk with Android studio and then pointing the editor preferences to the ndk installation folder. Still the editor complains about the version but is able to build.
     
  23. TheGeoff

    TheGeoff

    Joined:
    May 25, 2010
    Posts:
    14
    Any chance this got resolved?