Android NDK 环境变量配置
在编译生成.so时,提示
"ndk-build" is not found
原因:环境变量未设置
解决:
- 启动终端Terminal
- 编辑.bash_profile
// 输入
cd ~
// 创建.bash_profile
touch .bash_profile
// 编辑.bash_profile文件
open -e .bash_profile
按上图配置正确的NDK路径
- 更新刚配置的环境变量
source .bash_profile
或者 重新启动终端
- 命令行输入
// 验证是否能成功运行
ndk-build
参考文章:Mac使用技巧