本文主要是介绍(笔记)NDK is missing a “platforms“ directory. If you are using NDK, verify the ndk.dir is set to a val,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、问题
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to D:\AndroidStudioSDK\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
二、解决方法
1. 勾选NDK,点击OK
2. 点击右下角的Show Package Details展开所有的列表,然后在NDK(Side by Side)中选择你想要安装的NDK的版本
(1)如果选择下载全部NDK,则在NDK(Side by Side)前面打个钩
(2)如果选择部分下载,那么就在NDK(Side by Side)的列表中勾选任意的NDK版本
三、如果安装了NDK,sync还是失败的话,升级一下Gradle,视个人情况而定,我这里是最新的
1. 在gradle-wrapper.properties修改
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
2. 在project的build.gradle文件修改
dependencies {classpath 'com.android.tools.build:gradle:4.1.1'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files
}
3. 请注意你的local.properties文件下的ndk.dir目录是否与你下载的ndk目录一致
希望能帮到你
这篇关于(笔记)NDK is missing a “platforms“ directory. If you are using NDK, verify the ndk.dir is set to a val的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!