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?
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))
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With