解决Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !

想在windows环境下使用NDK-BUILD,于是安装了cygwin和ndk,编译JNI的时候出了下面的错误:

$ ./ndk-build -C samples/hello-jni
D:\android_sdk_windows\android-ndk-r7\prebuilt\windows\bin\awk.exe: can't open file /cygdrive/d/android_sdk_windows/android-ndk-r7/build/awk/check-awk.awk
 source line number 1 source file /cygdrive/d/android_sdk_windows/android-ndk-r7/build/awk/check-awk.awk
 context is
         >>>  <<<
Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !
make: 进入目录“/cygdrive/d/android_sdk_windows/android-ndk-r7/samples/hello-jni”
/cygdrive/d/android_sdk_windows/android-ndk-r7/build/core/init.mk:258: *** Android NDK: Aborting.    。 停止。
make: 离开目录“/cygdrive/d/android_sdk_windows/android-ndk-r7/samples/hello-jni”

日志提示是awk过期,这是因为NDK自带的awk.exe程序过期,把它删除,使用aygwin的awk工具就好了。

解决方法:直接删除android-ndk-r7\prebuilt\windows\bin\awk.exe文件

你可能感兴趣的:(Android)