Small question, we have a buildserver that must run unity in batch mode (no graphics card, so the editor interface cannot run). We have an Android project where we want to use il2cpp, but on that buildserver we get the error
“Error when building for platform Android: UnityException: Unable to detect NDK version, please pick a different folder.”
Obviously, because I haven’t set the folder. The documentation and other forum posts only refer to settings that folder via the editor interface. Is there a way to set this path without the editor interface?
You can always use Reflector, MonoDevelop or any other tool that lets you “peek” into compiled assemblies to find out how the editor stores this information.
You can try to do the same & assign this property to the actual path where you have the NDK installed (note that it has to be the exact version they’re looking for.
Right, thanks for the tip, it led me to a solution. I wrote this script and put it in an empty project called “SetNDKPath”:
using UnityEditor;
using UnityEngine;
public class SetPaths : MonoBehaviour
{
public static void SetNDKPath()
{
EditorPrefs.SetString("AndroidNdkRoot", @"E:\sdks\android-ndk-r10e");
Debug.LogFormat("Android NDK Path is now {0}", EditorPrefs.GetString("AndroidNdkRoot"));
}
}