Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

non-numeric second argument to 'wordlist'

I'm building a c project in Eclipse-android and get the following error:

This is a ndk build error (independent to my code)

/Users/eladb/MyWorkspace/android-ndk-r8e/build/gmsl/__gmsl:512: *** non-numeric second argument to 'wordlist' function: ''. Stop.

tried

android-ndk-r8b

android-ndk-r8e

how can I fix this?

like image 610
Elad Benda Avatar asked Jun 16 '13 09:06

Elad Benda


3 Answers

This is a known problem due to the r8d NDK not picking up properly the android:minSdkVersion property from the AndroidManifest.xml.

To work around that issue change the line 512 of the file /android-ndk-r8d/build/gmsl/__gmsl to:

int_encode = $(__gmsl_tr1)$(wordlist 1,$(words $1),$(__gmsl_input_int))
like image 63
Viraj Tank Avatar answered Nov 10 '22 20:11

Viraj Tank


In your AndroidManifest, add the following line:

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

This fixed the problem for me. You generally get this when importing a project you downloaded, as newly generated projects don't have that kind of error.

For information, this issue is also reproductible from the command-line.

like image 12
Geoffroy Avatar answered Nov 10 '22 19:11

Geoffroy


Looks like the XML parsing code in ndk-build is sensitive to whitespace (as of r8e.) I was getting this error when I had the following line in my manifest:

<uses-sdk android:minSdkVersion ="10" android:targetSdkVersion="11" />

The problem went away when I replaced it with the following line, removing the whitespace between minSdkVersion and the = sign:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="11" />

Ugh.

It's debatable whether you should patch the ndk (as described in the accepted answer) or do a workaround on the application side. I chose the workaround, as I work on a team with several different environments where we need to build, including a shared CI server, and I didn't want to go around patching the ndk for each environment and for each new developer. If you work solo, the accepted answer may be more appropriate as it will be fixed for your future projects as well.

like image 1
Eliot Avatar answered Nov 10 '22 19:11

Eliot