NDK 不包含任何平台 [英] NDK does not contain any platforms

查看:70
本文介绍了NDK 不包含任何平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想安装 NDK 以便能够使用 C/C++ 本机库.在尝试安装 NDK 时,我收到一条错误消息,说我的 C: 驱动器中没有足够的磁盘空间(因为下载位置是临时文件夹).

I want to install NDK to be able to use C/C++ native libraries. Upon trying to install the NDK, i get an error saying I do not have enough disk space in my C: Drive (because the download location is to the Temp Folder).

我已尝试更改系统变量中的临时路径,但 ndk 仍会下载到 C:\Users\User\Appdata\Local\Temp\PackageOperation02.

I've tried changing the temp path in the system variables but the ndk still downloads to C:\Users\User\Appdata\Local\Temp\PackageOperation02.

然后我转到项目结构以更改 Android NDK 位置,但是在尝试选择任何文件夹作为我的 NDK 位置时,我收到一条错误消息,指出NDK 不包含任何平台".

I then went to the project structure to change the Android NDK Location, but upon trying to choose ANY folder to be my NDK location, I get an error saying "NDK does not contain any platforms".

对此或为什么下载位置位于 Temp 文件夹的帮助将不胜感激.

Help for either that or why the download location is to the Temp folder would be appreciated.

推荐答案

对于在 2021 年看到此内容的人:

For people seeing this in 2021:

Android NDK 的 platform 目录自 r19 以来已过时.NDK 团队在 2021 年 1 月 在 r21 中将其完全删除.虽然它已经过时,它仍然会在项目结构"窗口中导致上述错误.Android Studio IDE 的稳定版(至少在 Mac 上)在选择 r21 或更高版本并尝试应用时仍在寻找 platform 目录.IDE 给出错误NDK 不包含任何平台".

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."

在 Android Studio 更新为停止寻找 platform 之前,您可以自己编辑 local.properties 文件,如下所示:

Until Android Studio is updated to stop looking for platform, you can edit the local.properties file yourself, like so:

ndk.dir=/Users/[username]/Library/Android/sdk/ndk/22.0.7026061
sdk.dir=/Users/[username]/Library/Android/sdk

这是项目结构窗口通常在幕后为您做的事情.

This is what the Project Structure window would normally do for you behind the scenes.

这篇关于NDK 不包含任何平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆