Android NDK revision 7 Host 'awk' tool is outdated error

10,407

Solution 1

Solved the problem.

Solution:

  1. Navigate to ../android-ndk-r7/prebuilt/linux-x86/bin
  2. Rename the file awk to awk_

Imoprtant thing to note on windows machine:

ndk revision 7 onwards, ndk source can be built without cygwin, ie.., instead of calling ndk-build command from inside a Cygwin shell, you should call run ndk-build.cmd inside a MSDOS command window.


It works because probably ndk-build first tries to use a locally defined, but old (at least for Linux), version of awk. By renaming it, we make it unreachable by such command, so, apparently, ndk-build calls the system-wide awk.

Solution 2

This Solution (from Santhosh) works also under windows:

  1. Navigate to ../android-ndk-r7/prebuilt/windows/bin Rename the file
  2. rename awk.exe to awk_.exe

Solution 3

I think the problem is $(HOST_AWK) not defined correctly and local prebuild awk.exe doesn't work. Thus prebuild awk.exe should be deleted or renamed and use gawk if awk is not defined.

To solve this problem:

1 - Rename <drive>\android-ndk\prebuilt\windows\bin\awk.exe to <drive>\android-ndk\prebuilt\windows\bin\awk_.exe.

2 - Open <drive>\android-ndk\build\core\init.mk

Replace

HOST_AWK := $(strip $(HOST_AWK))
ifndef HOST_AWK
    HOST_AWK := awk
endif

with

HOST_AWK := $(strip $(HOST_AWK))
ifndef HOST_AWK
    HOST_AWK := gawk
endif

Note that awk renamed to gawk.

Solution 4

Take a look at this japanese post: http://d.hatena.ne.jp/yohpapa/20111113/1321198570

They explain how to solve your problem. Is in japanese, but the commands are legible =)

Hope this helps...

Solution 5

I was having a problem with different versions of awk on windows. This change uses the cygwin version of awk from a cygwin console and the prebuilt version from a dos console.

Add to init.mk:

ifeq ($(HOST_OS),cygwin)
       HOST_AWK := /bin/awk
endif
Share:
10,407

Related videos on Youtube

MGK
Author by

MGK

Updated on June 04, 2022

Comments

  • MGK
    MGK almost 2 years

    I am getting "Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !" error on latest android ndk revision 7.

    • Graeme
      Graeme almost 12 years
      If you added a fix in ndk-7 by adding a HOST_AWK env variable, remove it before running ndk-8 or you will get the same error.
  • tofutim
    tofutim about 12 years
    What a random issue. Thank you so much.
  • Amir Saniyan
    Amir Saniyan about 12 years
    OMG! IT WRKS! Android is crazy :)
  • Shashank_Itmaster
    Shashank_Itmaster almost 11 years
    Thanks for to you man.As I am able to understand Japanese it's easy to solve.
  • ashraful
    ashraful almost 7 years
    but there is no awk file in my pc
  • sanyam jain
    sanyam jain about 2 years
    This solution still works!! Thanks you so much