Log in or register to post comments

Can't build Android NDK

April 25, 2011 - 2:03pm #1

Following the directions for installing Qualcomm MAR SDK, when I get to the last step of section 1, "Android NDK", I get the following error:

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: C:\Development\Android\android-ndk-r5b/jni/Android.mk
/cygdrive/c/Development/Android/android-ndk-r5b/build/core/add-application.mk:116: *** Android NDK: Aborting... . Stop.

I'm running Windows 7, and I'm pretty sure I've got all the environment variables set correctly.

I talked with somebody who was able to successfully install the MAR SDK and install ImageTest app on a phone, and he doesn't have the C:\Development\Android\android-ndk-r5b/jni directory mentioned in the error message.

Re: Can't build Android NDK

March 30, 2012 - 1:26pm #17

[QUOTE=robertross" />I applaud your commitment to this thread![/QUOTE" />

Thx. Just trying to prevent this: http://xkcd.com/979/

Re: Can't build Android NDK

March 30, 2012 - 8:42am #16

I applaud your commitment to this thread!

Re: Can't build Android NDK

March 29, 2012 - 12:29pm #15

Solved the problem, after several months on another project. Problem was an environment variable that should've been set only in eclipse I had set in my system environment variables.

Re: Can't build Android NDK

August 26, 2011 - 1:41pm #14

Hello,

When you run cygwin by opening the "Cygwin.bat" file type "which make" and you should see /usr/bin/make returned as the path to the make command. Cygwin is separate from windows and if your path isn't set correctly in Cygwin then it make not find the make command even though it is in C:\cygwin\bin . Re-installing will reset all your paths in cygwin correct and is probably the easiest way to track down a path problem.

Thank you,

-Peter

Re: Can't build Android NDK

August 26, 2011 - 12:30am #13

Hi,

I have the same issue.

How did re-installing either work?

Y

Re: Can't build Android NDK

July 6, 2011 - 6:15pm #12

Problem solved.

Re-installed NDK and cygwin.

Re: Can't build Android NDK

July 6, 2011 - 5:15pm #11

Hi,

I tried building the .so file using cygwin but am not able to.

It gives me " ERROR: Your GNUMAKE variable is defined to an invalid name: C/cygwin/bin/make
Please fix it to point to a valid make executable (e.g. /usr/bin/make) "

My path to my application as well as path to ndk has no spaces in it.

I also checked using command : make -v

It gives me error " Your GNUMAKE variable is defined to and invalid name. C"/cygwin/bin/make " Please fix it to point to a valid make executable (e.g. /usr/bin/make)

I see my make file in c:/cygwin/bin and my environment variable has path set to C:/cygwin/bin

What could be the problem ?

Re: Can't build Android NDK

May 6, 2011 - 6:28pm #10

Do you have a project based in the NDK root, because that's what's being identified as your project path ( i.e. /cygdrive/c/Development/Android/android-ndk-r5b )? OR have you set NDK_PROJECT_PATH to the NDK root?

Where's your AndroidManifest.xml? And where was that ndk-build run from?

This is a redacted version of what I get if I try to run ndk-build from the ndk root directory..

$ ndk-build NDK_LOG=1
Android NDK: NDK installation path auto-detected: '/cygdrive/c/Development/Andro
id/android-ndk-r5b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
...
Android NDK:  'cygpath' found as: /usr/bin/cygpath
...
Android NDK: Found stable platform levels: 3 4 5 8 9
Android NDK: Found max platform level: 9
Android NDK: Looking for AndroidManifest.xml in /cygdrive/c/development/android/
android-ndk-r5b
Android NDK: Looking for AndroidManifest.xml in /cygdrive/c/development/android
Android NDK: Looking for AndroidManifest.xml in /cygdrive/c/development
Android NDK: Looking for AndroidManifest.xml in /cygdrive/c
Android NDK: Looking for AndroidManifest.xml in /cygdrive
Android NDK: Looking for jni/Android.mk in /cygdrive/c/development/android/andro
id-ndk-r5b
Android NDK: Looking for jni/Android.mk in /cygdrive/c/development/android
Android NDK: Looking for jni/Android.mk in /cygdrive/c/development
Android NDK: Looking for jni/Android.mk in /cygdrive/c
Android NDK: Looking for jni/Android.mk in /cygdrive
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/cygdrive/c/Development/Android/android-ndk-r5b/build/core/build-local.mk:85: **
* Android NDK: Aborting    .  Stop.

Notice that it starts in the NDK root and drills down to /cygdrive looking for Android.xml & *.mk. Because there's no project established in that context, and NDK_PROJECT_PATH isn't set, the APP_BUILD_SCRIPT isn't called.

You can use printenv to take a look at your environmental variables to determine if any global NDK vars have been set.

Re: Can't build Android NDK

May 6, 2011 - 4:56pm #9
Tyro wrote:

...
So does 'which make' give you usr/bin/make ?

Yes, and I checked to make sure usr/bin/make exists. It does.

I took Tyro's advice of turning on the log, but I'm too new to Java programming for it to be meaningful to me. It looks like this, though:

Android NDK: NDK installation path auto-detected: '/cygdrive/c/Development/Android/android-ndk-r5b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to windows
Android NDK: Host awk tool was auto-detected: 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/q => Q:
/cygdrive/p => P:
/cygdrive/n => N:
/cygdrive/f => F:
/cygdrive/e => E:
/cygdrive/c => C:
/cygdrive/Q => Q:
/cygdrive/P => P:
/cygdrive/N => N:
/cygdrive/F => F:
/cygdrive/E => E:
/cygdrive/C => C:
/usr/lib => C:/cygwin/lib
/usr/bin => C:/cygwin/bin
/ => C:/cygwin
Android NDK:  This NDK supports the following toolchains and target ABIs:
Android NDK:    arm-eabi-4.4.0:  armeabi armeabi-v7a
Android NDK:    arm-linux-androideabi-4.4.3:  armeabi armeabi-v7a
Android NDK:    x86-4.2.1:  x86
Android NDK: Found platform root directory: /cygdrive/c/Development/Android/android-ndk-r5b/platforms
Android NDK: Found supported platforms: android-3 android-4 android-5 android-8 android-9
Android NDK: PLATFORM android-3 supports: arm
Android NDK:   ABI arm sysroot is: /cygdrive/c/Development/Android/android-ndk-r5b/platforms/android-3/arch-arm
Android NDK: PLATFORM android-4 supports: arm
Android NDK:   ABI arm sysroot is: /cygdrive/c/Development/Android/android-ndk-r5b/platforms/android-4/arch-arm
Android NDK: PLATFORM android-5 supports: arm
Android NDK:   ABI arm sysroot is: /cygdrive/c/Development/Android/android-ndk-r5b/platforms/android-5/arch-arm
Android NDK: PLATFORM android-8 supports: arm
Android NDK:   ABI arm sysroot is: /cygdrive/c/Development/Android/android-ndk-r5b/platforms/android-8/arch-arm
Android NDK: PLATFORM android-9 supports: arm
Android NDK:   ABI arm sysroot is: /cygdrive/c/Development/Android/android-ndk-r5b/platforms/android-9/arch-arm
Android NDK: Found stable platform levels: 3 4 5 8 9
Android NDK: Found max platform level: 9
Android NDK: Found project path: C:\Development\Android\android-ndk-r5b
Android NDK: Parsing /cygdrive/c/Development/Android/android-ndk-r5b/build/core/default-application.mk
Android NDK:   Defaulted to APP_PLATFORM=android-3
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: C:\Development\Android\android-ndk-r5b/jni/Android.mk    
/cygdrive/c/Development/Android/android-ndk-r5b/build/core/add-application.mk:116: *** Android NDK: Aborting...    .  Stop.

Re: Can't build Android NDK

May 6, 2011 - 3:55pm #8
Quote:

Out of curiosity, where is your ndk-build located? For me, which ndk-build says it's in

/cygdrive/c/Development/Android/android-ndk-r5b/ndk-build

Same on my system.

So does 'which make' give you usr/bin/make ?

and have you tried running ndk-build with logging on?

ndk-build NDK_LOG=1

This will give you an idea of where it's looking for the *.mk file. The search may fail and then default to the ndk root.

Re: Can't build Android NDK

May 6, 2011 - 2:53pm #7
Tyro wrote:

...

Have you tried compiling any of the NDK samples? - e.g. C:\Development\Android\android-ndk-r5b\samples\san-angeles

$ ndk-build

I was trying to compile the san-angeles demo when I encountered the problem. I haven't been able to compile the Qualcomm demos, either.

Tyro wrote:

...

Here's my Path variable, on a fresh Win7 64 installation..

PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_25\bin\;C:\Development\Android\android-sdk\tools\;C:\Development\Android\android-ndk-r5b\

also check your CLASSPATH to make sure that the local directory is included.
e.g.

CLASSPATH = .;

I've been able to compile, build, and install the ImageTarget sample on Win7 without any problems. My guess is that make isn't looking in the local directory, but instead using the NDK path. Notice the way that the Android.mk address is concatenated, using alternating back then forward slashes. ( C:\Development\Android\android-ndk-r5b/jni/Android.mk ).

My paths look similar. The local directory, ".", was in my CLASSPATH as the first entry. I noticed that I didn't have the Java JDK bin directory in my PATH, but putting it in didn't fix the problem.

Out of curiosity, where is your ndk-build located? For me, which ndk-build says it's in

/cygdrive/c/Development/Android/android-ndk-r5b/ndk-build

Re: Can't build Android NDK

May 6, 2011 - 2:02pm #6
Quote:

../jni/Android.mk

That make file should be in the samples directory - e.g. C:\Development\Android\qcar-sdk-1-0-0\samples\ImageTargets\jni\Android.mk

Have you tried compiling any of the NDK samples? - e.g. C:\Development\Android\android-ndk-r5b\samples\san-angeles

$ ndk-build

-----------------------------------------------------

Here's my Path variable, on a fresh Win7 64 installation..

PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_25\bin\;C:\Development\Android\android-sdk\tools\;C:\Development\Android\android-ndk-r5b\

also check your CLASSPATH to make sure that the local directory is included.
e.g.

CLASSPATH = .;

I've been able to compile, build, and install the ImageTarget sample on Win7 without any problems. My guess is that make isn't looking in the local directory, but instead using the NDK path. Notice the way that the Android.mk address is concatenated, using alternating back then forward slashes. ( C:\Development\Android\android-ndk-r5b/jni/Android.mk ).

Re: Can't build Android NDK

May 6, 2011 - 1:16pm #5
ksiva wrote:

Check out this thread, it's possible that cygwin is running the wrong version of make:

http://groups.google.com/group/android-ndk/browse_thread/thread/cc08f3cb83d9b66c

- Kim

Thanks, but that wasn't the problem. I looked at the thread, and in Cygwin, the make command did point to /usr/bin/make. I did notice that I didn't have a GNUMAKE variable set, so I ran the

export GNUMAKE=/usr/bin/make

command. Still got the same result as I described in my first post.

Re: Can't build Android NDK

May 6, 2011 - 10:34am #4

Check out this thread, it's possible that cygwin is running the wrong version of make:

http://groups.google.com/group/android-ndk/browse_thread/thread/cc08f3cb83d9b66c

- Kim

Re: Can't build Android NDK

May 6, 2011 - 6:46am #3
ksiva wrote:

First off, make sure you are running ndk-build from the correct directory (e.g. samples\ImageTargets). What is the full path to this directory on your machine? We typically recommend something like C:\Development\Android\qcar-sdk-xx-yy-zz\samples\ImageTargets (best to avoid spaces).

Have you changed the name of the project or the contents of the AndroidManifest.xml?

- Kim

I am running from that directory, w/o spaces in the path. Nor have changed any project names nor edited AndroidManifest.xml. AFAIK, I followed the installation instructions. I've completely removed Eclipse, the Android SDK and NDK from my machine, but I still get that error when I reinstall and try to build.

Re: Can't build Android NDK

April 25, 2011 - 2:39pm #2

First off, make sure you are running ndk-build from the correct directory (e.g. samples\ImageTargets). What is the full path to this directory on your machine? We typically recommend something like C:\Development\Android\qcar-sdk-xx-yy-zz\samples\ImageTargets (best to avoid spaces).

Have you changed the name of the project or the contents of the AndroidManifest.xml?

- Kim

Log in or register to post comments