android - Trying to compile JNI (native) parts of the NDK's San Angeles example (Windows)

I'm trying to do what the question says -- using a Cygwin shell. I've set it up according to 2 essentially equivalent tutorials I've Googled but yet I can not get the shell/make process to work properly. Unix/Cygwin skills lack, obviously.

So, my Cygwin is installed to it's default location and I've got the Android SDK and NDK set up right as well (normal Java apps work fine building/debugging from Eclipse).

This is how my modified Cygwin.bat looks:

@echo off

set IS_UNIX=
set DEV_ROOT=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles
set JAVA_HOME=c:/PROGRA~1/Java/jdk1.6.0_26
set CLASSPATH=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles/obj
set PATH=c:/PROGRA~1/Android/android-sdk/tools;c:/PROGRA~1/Android/android-ndk-r6
set ANDROID_NDK_ROOT=c:/PROGRA~1/Android/android-ndk-r6
set NDK_PROJECT_PATH=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles
chdir C:\cygwin\bin
bash --login -i

These paths are correct. When I change path to the NDK root and type ./ndk-build, this is the result:

nova@edwmini ~
$ cd c:/progra~1/android/android-ndk-r6

nova@edwmini /cygdrive/c/progra~1/android/android-ndk-r6
$ ./ndk-build
/cygdrive/c/progra~1/android/android-ndk-r6/build/core/ *** t
arget pattern contains no `%'.  Stop.

nova@edwmini /cygdrive/c/progra~1/android/android-ndk-r6

A kick in my ass in the right direction would be greatly appreciated.

1 Answer

  1. Frank- Reply


    I've fixed the problem using the comments.

    Firstly I had to go to the project path in order to build, secondly it helped when I replaced all the DOS paths for posix/Cygwin paths! Here is the new batch file:

    @echo off
    set DEV_ROOT=/cygdrive/c/PROGRA~1/Android/android-ndk-r6/samples/hello-gl2
    set IS_UNIX=
    set JAVA_HOME=/cygdrive/c/PROGRA~1/Java/jdk1.6.0_26
    set ANDROID_NDK_ROOT=/cygdrive/c/PROGRA~1/Android/android-ndk-r6
    set PATH=/cygdrive/c/PROGRA~1/Android/android-sdk/tools:%ANDROID_NDK_ROOT%:$PATH
    set CLASSPATH=%DEV_ROOT%/obj
    chdir C:\cygwin\bin
    bash --login -i

    The sample has changed but you'll get it. Also, @startup, do: cd $DEV_ROOT

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>