Monday, November 19, 2012

How to fix Android NDK Error: non-numeric second...

First of all, My English sucks ;)

Problem:

When I did ndk-build on terminal with a new android project and I got a follow message.

$ ndk-build
android-ndk-r8c/build/gmsl/__gmsl:512: *** non-numeric second argument to `wordlist' function: ''. Stop.

 
How To Fix:

Just simply add android:minSdkVersion tag to AndroidManifest.xml.

<uses-sdk android:minSdkVersion="3" />

What I did:

It seems something goes wrong so I decided remove project files one per one before hack the 512 line of __gmsl because I believe the ndk version "r8c" which I used.

Finally, I got the reason of build fail is 'AndroidManifest.xml'.

$ rm -f AndroidManifest.xml
$ ndk-build
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Install : libhello.so => libs/armeabi/libhello.so

Then I tried do diff with sample codes which's shipped with Android NDK


$ android create project -t 2 -k com.myproject -a HelloActivity -p .
$ diff AndroidManifest /path/to/android-ndk/samples/hello-jni/AndroidManifest.xml
...
<uses-sdk android:minSdkVersion="3" />
...

DAMN!