NDK Build failing

2019-08-03 18:15发布

问题:

Am new to working with ndk. Seeing some posts and googling around i found the way to compile my native files using NDK. I installed ndk r7c. However when i used the command ndk-build i got the following error:

/cygdrive/d/android-ndk-r7c-windows/android-ndk-r7c/ndk-build
/cygdrive/d/android-ndk-r7c-windows/android-ndk-r7c/ndk-build: line 40: dirname: command not found
/cygdrive/d/android-ndk-r7c-windows/android-ndk-r7c/ndk-build: line 78: uname: command not found
ERROR: Unknown host operating system:

My directory for the project was:

Haris Riaz@HarisRiaz-PC /cygdrive/d/reader-2/android/jni

Am unable to know the nature of the problem. Please help me whats this error about and how to solve it. Thank You!

回答1:

From Haris Riaz@HarisRiaz-PC I can deduct that you are running on Linux. But according to android-ndk-r7c-windows, you are trying to run a windows version ow the NDK. And ERROR: Unknown host operating system: confirms this. Download Linux version of the NDK from here and you should be fine.