问题描述

下图为配置Android NDK location的界面:

如下图所示,在配置NDK时(Choose NDK Location),提示:NDK does not contain any platforms.

问题分析

Android-SDK\ndk\25.1.8937393目录下确实没有platforms文件夹,因此会有上面的提示。

请参考下面的解释:

The Android NDK’s platform directory has been obsolete since r19. The NDK team removed it altogether in r21 in January 2021. Although it is obsolete, it can still cause the above error in the Project Structure window. The stable version of the Android Studio IDE (at least on Mac) is still looking for the platform directory when you select an r21 or higher version and try to Apply it. The IDE gives the error “NDK does not contain any platforms.

简单来说就是NDK开发在最新的时代废除了以前需要platforms的文件夹机制。

解决方法

在你选择的Android-SDK\ndk\25.1.8937393目录下创建一个空platforms文件夹即可。