Linux 在 Ubuntu 终端中找不到 ndk-build 命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14891399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 19:02:14  来源:igfitidea点击:

ndk-build command not found in Ubuntu terminal

androidlinuxandroid-ndk

提问by Sanidhya Kumar

I have successfully generated .h file using javah, now i want to build my android-ndk hello world project. But it says command not found nespl@nespl-pc:~$ ndk-build ndk-build: command not found

我已经使用 javah 成功生成了 .h 文件,现在我想构建我的 android-ndk hello world 项目。但它说找不到命令 nespl@nespl-pc:~$ ndk-build ndk-build: command not found

this is my path

这是我的道路

nespl@nespl-pc:~$ echo $PATH
/home/nespl/android-ndk-r8/ndk-build:/home/nespl/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/nespl/adt-bundle-linux-x86/sdk/tools:/home/nespl/adt-bundle-linux-x86/sdk/platform-tools:/home/nespl/gsutil

采纳答案by Kevin Coppock

Your PATH should include the root directory of your NDK:

您的 PATH 应包含 NDK 的根目录:

export PATH=$PATH:/home/nespl/android-ndk-r8

instead of your current:

而不是你当前的:

export PATH=$PATH:/home/nespl/android-ndk-r8/ndk-build