I was configuring a new Android Studio project and encountered the error “The NDK does not contain any platforms”. This seemed odd because Android Studio downloaded and installed the NDK for me. Because I am unfamiliar with Android development this left me confused. Why would Studio download and incorrectly install the NDK?

This appears to be a hold over from a change that was made at least 4 years ago in the NDK. The Android NDK no longer ships with a platform directory and that causes the official Android development IDE to break. Break in this case means that you cannot save the location of the NDK that it itself downloaded and installed.

To fix this you can manually add the location of the Android NDK to the local.properties file located in the Gradle Scripts section of the IDE.

For my user I set the following

ndk.dir=/home/me/Android/Sdk/ndk/25.2.9519653