Issue with build Android NDK project

2020-06-20 06:23发布

I try to build project in Eclipse on Linux Ubuntu. Eclipse show error message:

**** Build of configuration Default for project FFVideo ****

/home/art/android-ndk-r7b/ndk-build V=1 

Cannot run program "/home/art/android-ndk-r7b/ndk-build": Unknown reason
Error: Program "/home/art/android-ndk-r7b/ndk-build" is not found in PATH

PATH=[/home/art/android-ndk-r7b:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]

**** Build Finished ****

Why it happened?

4条回答
\"骚年 ilove
2楼-- · 2020-06-20 06:36

You need to set the path to android ndk in eclipse.
1. Open C/C++ Perspective.
2. Right click on the project, and select "Properties"
3. Select C/C++ Build => Environment
4. Add PATH environment variable, include path to the android ndk.

查看更多
成全新的幸福
3楼-- · 2020-06-20 06:44

I found the solution by adding the NDK-path to the path variable, in the ubuntu terminal as well as in eclipse. Then I had to DELETE THE ".cmd" in "ndk-build.cmd" because the terminal says that I have no permission with this file ending.

查看更多
我命由我不由天
4楼-- · 2020-06-20 06:45

This worked for me, but I had to execute this command at the terminal, because the problem was with permissions.

sudo chmod 777 -R android-ndk-r8c/

查看更多
▲ chillily
5楼-- · 2020-06-20 06:52

Yes, this works for me too...

This seems to tell, Ecipse IDE uses PATH before .bashrc ? What I mean is: I've got PATH="$PATH:/opt/android-sdk-linux/tools/:/opt/android-sdk-linux/platform-tools:/opt/android-ndk-r8c in .bashrc, but Eclipse IDE uses PATH without android-sdk/android-ndk settings.

A kind of weird to me....

查看更多
登录 后发表回答