问题描述
我已经设置了 ANDROID_NDK_HOME
为 /用户/ Shajilshocker /文档/ Android版/ NDK / Android的NDK-r10b
使用一个被称为Mac OSX版应用程序的的环境变量的
I had set the ANDROID_NDK_HOME
as /Users/Shajilshocker/Documents/Android/NDK/android-ndk-r10b
using a mac osx application called Environment Variables.
我已经证实,它在终端设置正确路径
I had confirmed that it set the path correctly in Terminal
回声$ ANDROID_NDK_HOME
但是,当我在调用的Android Studio项目运行shell文件 NDK的构建
我收到以下错误
But when I run a shell file in a Android Studio project which invokes ndk-build
I get the following error
NDK的构建:命令未找到
如何确保NDK的构建是在构建路径?
How to make sure that ndk-build is in your build path ?
如何在我的构建路径设置NDK的构建?
How to set ndk-build in my build path ?
感谢您的帮助。
推荐答案
好吧,其实这是不够的,让系统知道的路径。您必须将此路径添加到 PATH
系统变量。在你的情况,你所要做的是以下行添加到您的终端配置文件(这应该是你的主目录,命名为下的.bashrc
如果您保留了默认终端,完整路径:〜/ .bashrc中
)
Well, this is actually not enough to make the system aware of the path. You must add this path to the PATH
system variable. In your case, all you have to do is to add the following line to your terminal configuration file (which should be under your home directory, named .bashrc
if you kept the default terminal, full path: ~/.bashrc
):
export PATH=$PATH:/Users/Shajilshocker/Documents/Android/NDK/android-ndk-r10b
这是什么行代码实际添加路径到你的Android NDK目录到 PATH
变量。您导出一个名为变量 PATH
与当前内容加上您的NDK的目录。
What this line does is actually adding the path to your Android NDK directory to the PATH
variable. You export a variable named PATH
with its current content plus the directory of your NDK.
一步一步:
- 转至
- 编辑
的.bashrc
- 添加行我上面显示
- 保存,退出,再重新启动的bash(你只需要键入
庆典
,然后输入)
在主目录
- Go in the home directory
- Edit
.bashrc
- Add the line I showed above
- Save, exit, then restart bash (you just have to type
bash
, then enter)
这篇关于如何设置NDK构建路径在OSX为Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!