iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article

[Unity] Resolving the "ANDROID_NDK_ROOT is undefined or empty" error

に公開

Conclusion

  • Select an appropriate folder in File → Build Settings → Export and try building once.
    • This will enable you to build.
  • Or refer to the following article:

Situation

BuildFailedException: Burst compiler (1.4.11) failed running

stdout:
Burst requires the android NDK to be correctly installed (it can be installed via the unity installer add component) in order to build a standalone player for Android with ARMV7A_NEON32
The environment variable ANDROID_NDK_ROOT is undefined or empty, is the Android NDK correctly installed?
stderr:
Error building Player: BuildFailedException: Burst compiler (1.4.11) failed running

stdout:
Burst requires the android NDK to be correctly installed (it can be installed via the unity installer add component) in order to build a standalone player for Android with ARMV7A_NEON32
The environment variable ANDROID_NDK_ROOT is undefined or empty, is the Android NDK correctly installed?
stderr:

Error

Attempting to run the Unity build from the editor (script)

  • Instead of the standard File → Build Settings → Export, I was trying to build using BuildPipeline via a script.

https://qiita.com/_udonba/items/35deb83e966191901e73
https://dtnavi.tcdigital.jp/dev_blog/programming/unity-メニューを追加する/
https://docs.unity3d.com/ja/2022.3/Manual/BuildPlayerPipeline.html

Others

  • NDK/SDK already installed in Unity
  • Had never performed an Android build before

Environment

  • M1 MacBook Pro
  • macOS Sonoma

Solution

  • Select an appropriate folder via File → Build Settings → Export and try building once

Discussion