You are missing the recommended Android NDK.

Heyhey,

I’ve been cracking my head on this issue for hours now, was wondering if anyone had an idea.
I installed the Android modules today on 2020.3.21f1, and managed to build my APK a few times to test, when suddenly it just stopped working after like 5 or 6 builds. No settings changes or anything.
Now when I try to build I get greeted with the message.
“Android NDK not found or invalid. Please, fix it in Edit / Unity → Preferences → External Tools”

And when I go and check the preferences I see this.

When I try to manually browse to the NDK folder (I need the root NDK folder, right? Not platforms or build or anything funny inside it, right?) I get this message “Unable to detect NDK in the selected directory”.

I tried every suggestion I found online.

  1. I Tried restarting the editor and the computer.
  2. Tried changing the Unity version to 2019, and to 2021.
  3. Tried switching platform between PC and back to Android.
  4. Tried downloading the relevant NDK version (r19 for 2020, r21 for 2021) and linking to it (Still doesn’t let me select the folder no matter where I browse to).
  5. Tried replacing the ndk that came installed with with the Android module with the manually downloaded version.
  6. Tried selecting the NDK when placed in a directory path with no spaces.

I also couldn’t really find any relevant topics on Answers or the forums that were more recent than 2017-2019.
Nothing works and I’m completely out of ideas…

Please, if anyone has any ideas, do let me know.

Thanks

Install Android Studio. It does a much better job managing all the SDK/NDK packages needed for your builds. You can set up from the welcome screen just click on the gear icon on bottom right. No need to full start the software. I came with similar issues and this solved it all.

Well, turns out it actually WAS a change I did.
I added the I18N dlls from the mono/unity folder as suggested in this post to resolve some localization issue, and for some reason that caused the NDK to not be recognized anymore… Go figure.

Removing those from the project solves the issue, and copying the equivalent DLLs from the mono/unityjit folder instead was apparently what I wanted to do to solve the issue without breaking builds.