This probably happens because Android Studio will automatically download the latest version of NDK which doesn't have a platforms
directory (No idea why! Would be awesome if someone can clarify that).
This is what worked for me. Using the SDK manager. That is the icon in the top right corner of Android Studio that looks like this . Go to SDK Tools tab. In the right bottom corner, enable Show Package Details and install NDK version 20.0.5594570 (You can remove the newer version that was installed automatically by Android Studio to save space).
Note that the NDK will be installed in the location shown in Android SDK Location. For me that is set to /home/<username>/.local/android-sdk
. Which means I can find the NDK at /home/<username>/.local/android-sdk/ndk/20.0.5594570/
Hit apply and when it's done go to file called local.properties
and add this.
ndk.dir=/home/<username>/.local/android-sdk/ndk/20.0.5594570
Adapt the path to where you have your NDK installed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…