I have installed Eclipse (v22.3.0-887826), Andriod NDK R9B, and Cygwin (v 1.7.27) on a mature XP(SP3) system. All installed without incident. Being an experienced developer in other disciplines, I began building my first app in the IDE right away. Everything went smoothly until I could not create a shared library. So I went to the tutorials and imported 'Hello-jni' as existing code, and setup the ndk-build as specified. The build errors on creating the shared library: /cygdrive/c/Android-ndk-r9b/build/core/build-binary.mk:577: recipe for target '/cygdrive/C/Android/workspace/hellojni/obj/local/armeabi/libhello-jni.so' failed
I set android:debuggable="false" in the manifest as the first errors referenced output to the debug sub-directories. The -clean and -B options were also tested.
The ouput from build: Larry@eros /cygdrive/c/android/workspace/hellojni $ $NDK/ndk-build V=1
rm -f /cygdrive/C/Android/workspace/hellojni/libs/armeabi/lib*.so /cygdrive/C/Android/workspace/hellojni/libs/armeabi-v7a/lib*.so /cygdrive/C/Android/workspace/hellojni/libs/mips/lib*.so /cygdrive/C/Android/workspace/hellojni/libs/x86/lib*.so
rm -f /cygdrive/C/Android/workspace/hellojni/libs/armeabi/gdbserver /cygdrive/C/Android/workspace/hellojni/libs/armeabi-v7a/gdbserver /cygdrive/C/Android/workspace/hellojni/libs/mips/gdbserver /cygdrive/C/Android/workspace/hellojni/libs/x86/gdbserver
rm -f /cygdrive/C/Android/workspace/hellojni/libs/armeabi/gdb.setup /cygdrive/C/Android/workspace/hellojni/libs/armeabi-v7a/gdb.setup /cygdrive/C/Android/workspace/hellojni/libs/mips/gdb.setup /cygdrive/C/Android/workspace/hellojni/libs/x86/gdb.setup
[armeabi] Compile thumb : hello-jni <= hello-jni.c
/cygdrive/c/Android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gcc -MMD -MP -MF C:/Android/workspace/hellojni/obj/local/armeabi/objs/hello-jni/hello-jni.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -IC:/Android/workspace/hellojni/jni -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security -IC:/Android-ndk-r9b/platforms/android-16/arch-arm/usr/include -c C:/Android/workspace/hellojni/jni/hello-jni.c -o C:/Android/workspace/hellojni/obj/local/armeabi/objs/hello-jni/hello-jni.o && /cygdrive/C/Android/workspace/hellojni/obj/convert-dependencies.sh C:/Android/workspace/hellojni/obj/local/armeabi/objs/hello-jni/hello-jni.o.d
[armeabi] SharedLibrary : libhello-jni.so
/cygdrive/c/Android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ -Wl,-soname,libhello-jni.so -shared --sysroot=C:/Android-ndk-r9b/platforms/android-16/arch-arm C:/Android/workspace/hellojni/obj/local/armeabi/objs/hello-jni/hello-jni.o -lgcc -no-canonical-prefixes -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm -o C:/Android/workspace/hellojni/obj/local/armeabi/libhello-jni.so
/cygdrive/c/Android-ndk-r9b/build/core/build-binary.mk:577: recipe for target '/cygdrive/C/Android/workspace/hellojni/obj/local/armeabi/libhello-jni.so' failed
And output from $ env:
HOMEPATH=\Documents and Settings\Larry
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
NDK=/cygdrive/c/Android-ndk-r9b
APPDATA=C:\Documents and Settings\Larry\Application Data
HOSTNAME=eros
SHELL=/bin/bash
TERM=xterm
PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel
ANDROID_SDK_PATH=/cygdrive/c/Android/adt-bundle-windows-x86-20131030
WINDIR=C:\WINDOWS
ANDROID_SDK_ROOT=C:\Android\adt-bundle-windows-x86-20131030
OLDPWD=/home/Larry
ClassicVB-lm=Rocks!
USERDOMAIN=EROS
OS=Windows_NT
ALLUSERSPROFILE=C:\Documents and Settings\All Users
ANT_HOME=C:\Android\apache-ant-1.9.2-bin\apache-ant-1.9.2
$NDK_PROJECT_PATH=/cygdrive/c/Android/workspace/hellojni
$NDK_ROOT=/cygdrive/c/android-ndk-r9b
USER=Larry
TEMP=/tmp
temp=C:\DOCUME~1\Larry\LOCALS~1\Temp
COMMONPROGRAMFILES=C:\Program Files\Common Files
tmp=C:\DOCUME~1\Larry\LOCALS~1\Temp
ANDROID_NDK_ROOT=C:\android-ndk-r9b
QTJAVA=C:\Program Files\Java\jre7\lib\ext\QTJava.zip
USERNAME=Larry
PROCESSOR_LEVEL=15
PATH=/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/Borland/Delphi7/Bin:/cygdrive/c/Program Files/Borland/Delphi7/Projects/Bpl:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS/system32/WBEM:/cygdrive/c/PsTools:/cygdrive/c/Program Files/Common Files/Adobe/AGL:/cygdrive/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/cygdrive/c/FPC/2.4.2/bin/i386-Win32:/cygdrive/c/Program Files/QuickTime/QTSystem:/cygdrive/c/Android/apache-ant-1.9.2-bin/apache-ant-1.9.2
FP_NO_HOST_CHECK=NO
PWD=/cygdrive/c/android/workspace/hellojni
SYSTEMDRIVE=C:
GNUMAKE=/usr/bin/make
VBROKERDIR=C:\Inprise\vbroker
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45
LANG=en_US.UTF-8
USERPROFILE=C:\Documents and Settings\Larry
CLIENTNAME=Console
TZ=America/Los_Angeles
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$
LOGONSERVER=\\EROS
ARM_PATH=/cygdrive/C/android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin
ClassicVB-cu=Rocks!
ANDROID_NDK_PATH=/cygdrive/c/andriod-ndk-r9b
PROCESSOR_ARCHITECTURE=x86
SHLVL=1
HOME=/home/Larry
$NDK=/cygdrive/c/Android-ndk-r9b
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
HOMEDRIVE=C:
COMSPEC=C:\WINDOWS\system32\cmd.exe
TMP=/tmp
SYSTEMROOT=C:\WINDOWS
PRINTER=HP LaserJet 1100 (MS)
PROCESSOR_REVISION=0209
CLASSPATH=.;C:\Program Files\Java\jre7\lib\ext\QTJava.zip
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
PROGRAMFILES=C:\Program Files
NUMBER_OF_PROCESSORS=2
NDK_PROJECT_PATH=/cygdrive/C/Android/workspace/hellojni
NDK_ROOT=/cygdrive/c/Android-ndk-r9b
SESSIONNAME=Console
COMPUTERNAME=EROS
_=/usr/bin/env
Finally, output from NDK_LOG=1:
HOST_OS=cygwin
HOST_ARCH=x86
HOST_TAG=cygwin-x86
GNUMAKE=/usr/bin/make (from environment variable)
Cygwin-compatible GNU make detected
Android NDK: NDK installation path auto-detected: '/cygdrive/c/Android-ndk-r9b'
Android NDK: GNU Make version 4.0 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Found /bin/uname.exe on Windows host
Android NDK: uname -s returned: CYGWIN_NT-5.1
Android NDK: Cygwin detected: CYGWIN_NT-5.1 eros 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin
Android NDK: Host operating system detected: cygwin
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to windows
Android NDK: Host tools prebuilt directory: /cygdrive/c/Android-ndk-r9b/prebuilt/windows/bin
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'echo -n' tool: printf %s
Android NDK: Host 'cmp' tool: /cygdrive/c/Android-ndk-r9b/prebuilt/windows/bin/cmp
Android NDK: Host 'awk' tool: awk
Android NDK: Host 'awk' test returned: Pass
Android NDK: Probing for 'cygpath' program
Android NDK: 'cygpath' found as: /usr/bin/cygpath
Using cygwin substitution rules:
/cygdrive/f => F:
/cygdrive/c => C:
/cygdrive/F => F:
/cygdrive/C => C:
/usr/lib => C:/cygwin/lib
/usr/bin => C:/cygwin/bin
/ => C:/cygwin
Android NDK: Found platform root directory: /cygdrive/c/Android-ndk-r9b/platforms
Android NDK: Found supported platforms: android-4 android-17 android-18 android-19 android-13 android-3 android-14 android-15 android-8 android-9 android-16 android-5
Android NDK: PLATFORM android-4 supports: arm
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-4/arch-arm
Android NDK: PLATFORM android-17 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-17/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-17/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-17/arch-mips
Android NDK: PLATFORM android-18 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-18/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-18/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-18/arch-mips
Android NDK: PLATFORM android-19 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-19/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-19/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-19/arch-mips
Android NDK: PLATFORM android-13 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-13/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-13/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-13/arch-mips
Android NDK: PLATFORM android-3 supports: arm
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-3/arch-arm
Android NDK: PLATFORM android-14 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-14/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-14/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-14/arch-mips
Android NDK: PLATFORM android-15 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-15/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-15/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-15/arch-mips
Android NDK: PLATFORM android-8 supports: arm
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-8/arch-arm
Android NDK: PLATFORM android-9 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-9/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-9/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-9/arch-mips
Android NDK: PLATFORM android-16 supports: x86 arm mips
Android NDK: ABI x86 sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-16/arch-x86
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-16/arch-arm
Android NDK: ABI mips sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-16/arch-mips
Android NDK: PLATFORM android-5 supports: arm
Android NDK: ABI arm sysroot is: /cygdrive/c/Android-ndk-r9b/platforms/android-5/arch-arm
Android NDK: Found stable platform levels: 4 17 18 19 13 3 14 15 8 9 16 5
Android NDK: Found max platform level: 19
Android NDK: This NDK supports the following target architectures and ABIS:
Android NDK: arm: armeabi armeabi-v7a
Android NDK: mips: mips
Android NDK: x86: x86
Android NDK: This NDK supports the following toolchains and target ABIs:
Android NDK: arm-linux-androideabi-4.6: armeabi armeabi-v7a
Android NDK: arm-linux-androideabi-4.8: armeabi armeabi-v7a
Android NDK: arm-linux-androideabi-clang3.3: armeabi armeabi-v7a
Android NDK: mipsel-linux-android-4.6: mips
Android NDK: mipsel-linux-android-4.8: mips
Android NDK: mipsel-linux-android-clang3.3: mips
Android NDK: x86-4.6: x86
Android NDK: x86-4.8: x86
Android NDK: x86-clang3.3: x86
Android NDK: Found project path: /cygdrive/C/Android/workspace/hellojni
Android NDK: Ouput path: /cygdrive/C/Android/workspace/hellojni/obj
Android NDK: Parsing /cygdrive/c/Android-ndk-r9b/build/core/default-application.mk
Android NDK: Found APP_PLATFORM=android-16 in /cygdrive/C/Android/workspace/hellojni/project.properties
Android NDK: APP_PIE is
Android NDK: Enabling -fPIE
Android NDK: Using build script /cygdrive/C/Android/workspace/hellojni/jni/Android.mk
Android NDK: Application 'local' is not debuggable
Android NDK: Selecting release optimization mode (app is not debuggable)
Android NDK: Adding import directory: /cygdrive/c/Android-ndk-r9b/sources
Android NDK: Building application 'local' for ABI 'armeabi'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.6' for 'armeabi' ABI
Android NDK: Looking for imported module with tag 'cxx-stl/system'
Android NDK: Probing /cygdrive/c/Android-ndk-r9b/sources/cxx-stl/system/Android.mk
Android NDK: Found in /cygdrive/c/Android-ndk-r9b/sources/cxx-stl/system
Android NDK: [armeabi] Modules to build: hello-jni
Android NDK: Cygwin dependency file conversion script:
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then sed -e 's!^C:/cygwin/lib!/usr/lib!ig;s! C:/cygwin/lib! /usr/lib!ig;s!^C:/cygwin/bin!/usr/bin!ig;s! C:/cygwin/bin! /usr/bin!ig;s!^C:/cygwin/!/!ig;s! C:/cygwin/! /!ig;s!^F:!/cygdrive/f!ig;s! F:! /cygdrive/f!ig;s!^C:!/cygdrive/c!ig;s! C:! /cygdrive/c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
[armeabi] Compile thumb : hello-jni <= hello-jni.c
[armeabi] SharedLibrary : libhello-jni.so
/cygdrive/c/Android-ndk-r9b/build/core/build-binary.mk:577: recipe for target '/cygdrive/C/Android/workspace/hellojni/obj/local/armeabi/libhello-jni.so' failed
I have spent several days trying to solve this issue on my own. I have re-installed everything three times now, and just can't see the problem. Any help on this matter will be greatly appreciated. Thanks.
It seems the toolchain generates the file: C:/Android/workspace/hellojni/obj/local/armeabi/libhello-jni.so but fails because the recipe should have been for: /cygdrive/C/Android/workspace/hellojni/obj/local/armeabi/libhello-jni.so
While these two represent absolutely the same file, it doesn't seem to work. You can either try to switch all your env paths to /cygdrive/ notation or simply remove cygwin. You usually don't need to use cygwin to use the Android NDK, it already has a complete standalone toolchain that may work better.