2
cd Documents/workspace/ndkfoo

home of my project

and then i try to run ndk-build command but keeps on getting

ndk-build
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/jni/Android.mk   

i got that APP_BUILD_SCRIPT is pointing to a different place it should be /Users/naveenkumar/Documents/workspace/ndkfoo/jni/Android.mk i am having my Android.mk at this place...

but i dont kw how to change APP_BUILD_SCRIPT to this path :( ,,thnks in advance

my Android.mk is fine ...here is my Android.mk which is under jni folder of project:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#here we give our module name and source files.
LOCAL_MODULE := ndkfoo
LOCAL_SRC_FILES := ndkfoo.c
include $(BUILD_SHARED_LIBRARY)

and when i run it with NDK_LOG=1 i get the following

NAVEEN-KUMARs-MacBook-Pro:ndkfoo naveenkumar$ /Users/naveenkumar/Downloads/android-ndk-r8/ndk-build NDK_LOG=1
HOST_OS=darwin
HOST_ARCH=x86_64
HOST_TAG=darwin-x86 (no 64-bit prebuilt binaries detected)
GNUMAKE=/Users/naveenkumar/Downloads/android-ndk-r8/prebuilt/darwin-x86/bin/make (NDK prebuilt)
Android NDK: NDK installation path auto-detected: '/Users/naveenkumar/Downloads/android-ndk-r8'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: darwin
Android NDK:  Host operating system detected: darwin
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to darwin-x86
Android NDK: Host tools prebuilt directory: /Users/naveenkumar/Downloads/android-ndk-r8/prebuilt/darwin-x86/bin
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'awk' tool: /Users/naveenkumar/Downloads/android-ndk-r8/prebuilt/darwin-x86/bin/awk
Android NDK: Host 'awk' test returned: Pass
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.4.3:  armeabi armeabi-v7a
Android NDK:    mipsel-linux-android-4.4.3:  mips
Android NDK:    x86-4.4.3:  x86
Android NDK: Found platform root directory: /Users/naveenkumar/Downloads/android-ndk-r8/platforms
Android NDK: Found supported platforms: android-14 android-3 android-4 android-5 android-8 android-9
Android NDK: PLATFORM android-14 supports: arm mips x86
Android NDK:   ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-14/arch-arm
Android NDK:   ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-14/arch-mips
Android NDK:   ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-14/arch-x86
Android NDK: PLATFORM android-3 supports: arm mips x86
Android NDK:   ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-3/arch-arm
Android NDK:   ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-3/arch-mips
Android NDK:   ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-3/arch-x86
Android NDK: PLATFORM android-4 supports: arm mips x86
Android NDK:   ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-4/arch-arm
Android NDK:   ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-4/arch-mips
Android NDK:   ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-4/arch-x86
Android NDK: PLATFORM android-5 supports: arm mips x86
Android NDK:   ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-5/arch-arm
Android NDK:   ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-5/arch-mips
Android NDK:   ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-5/arch-x86
Android NDK: PLATFORM android-8 supports: arm mips x86
Android NDK:   ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-8/arch-arm
Android NDK:   ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-8/arch-mips
Android NDK:   ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-8/arch-x86
Android NDK: PLATFORM android-9 supports: arm mips x86
Android NDK:   ABI arm sysroot is: /Users/naveenkumar/Downloads/android-ndk-    r8/platforms/android-9/arch-arm
Android NDK:   ABI mips sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-9/arch-mips
Android NDK:   ABI x86 sysroot is: /Users/naveenkumar/Downloads/android-ndk-r8/platforms/android-9/arch-x86
Android NDK: Found stable platform levels: 14 3 4 5 8 9
Android NDK: Found max platform level: 14
Android NDK: Found project path: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin
Android NDK: Ouput path: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/obj
Android NDK: Parsing /Users/naveenkumar/Downloads/android-ndk-r8/build/core/default-application.mk
Android NDK:   Defaulted to APP_PLATFORM=android-3
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/jni/Android.mk    
/Users/naveenkumar/Downloads/android-ndk-r8/build/core/add-application.mk:133: *** Android NDK: Aborting...    .  Stop.

As we can see i am home directory..and still it takes that wrong and also my Application.mk which i put under jni so i tried pasting these three lines in Application.mk

APP_PROJECT_PATH := /Users/naveenkumar/Documents/workspace/ndkfoo
APP_BUILD_SCRIPT := /Users/naveenkumar/Documents/workspace/ndkfoo/jni/Android.mk
APP_MODULES      := ndkfoo

The directory structure is as follows: now as i was able to run this once so it is having .o and other libraries that it generates ......

NAVEEN-KUMARs-MacBook-Pro:workspace naveenkumar$ find ndkfoo/ -type f

ndkfoo//.classpath
ndkfoo//.project
ndkfoo//AndroidManifest.xml
ndkfoo//bin/classes/com/gslab/ndkdemo/BuildConfig.class
ndkfoo//bin/classes/com/gslab/ndkdemo/NDKFooActivity.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$attr.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$drawable.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$layout.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R$string.class
ndkfoo//bin/classes/com/gslab/ndkdemo/R.class
ndkfoo//bin/classes.dex
ndkfoo//bin/ndkfoo.apk
ndkfoo//bin/res/drawable-hdpi/icon.png
ndkfoo//bin/res/drawable-ldpi/icon.png
ndkfoo//bin/res/drawable-mdpi/icon.png
ndkfoo//bin/resources.ap_
ndkfoo//gen/com/gslab/ndkdemo/BuildConfig.java
ndkfoo//gen/com/gslab/ndkdemo/R.java
ndkfoo//jni/Android.mk
ndkfoo//jni/Application.mk
ndkfoo//jni/ndkfoo.c
ndkfoo//libs/armeabi/libndkfoo.so
ndkfoo//obj/local/armeabi/libndkfoo.so
ndkfoo//obj/local/armeabi/objs/ndkfoo/ndkfoo.o
ndkfoo//obj/local/armeabi/objs/ndkfoo/ndkfoo.o.d
ndkfoo//proguard.cfg
ndkfoo//project.properties
ndkfoo//res/drawable-hdpi/icon.png
ndkfoo//res/drawable-ldpi/icon.png
ndkfoo//res/drawable-mdpi/icon.png
ndkfoo//res/layout/main.xml
ndkfoo//res/values/strings.xml
ndkfoo//src/com/gslab/ndkdemo/NDKFooActivity.java

This is not duplicate of build script not found since I am pointing to the correct build path and cmake is triggered.

Amit Hooda
  • 2,133
  • 3
  • 23
  • 37
  • Please add your `Android.mk` to the question. – Samveen May 22 '12 at 11:31
  • I have edited the question giving maximum possible details ,,,,help me out ,,,, – Amit Hooda May 23 '12 at 07:09
  • From what I can figure, your $PATH variable seems to be what is prepended to the filename `jni/Android.mk`. Can you attach filelist of the project to the question: `find ~/Documents/workspace/ndkfoo -type f` . This will help confirm if the layout of the files is correct. – Samveen May 23 '12 at 10:30
  • i hav provided the directory structure of my project ,,,the library that is present is because it ran earlier 2-3 times after that it is not working,,,and yes you are right about the $PATH variable but if i make changes to the PATH variable then also it doesnt work :( – Amit Hooda May 24 '12 at 06:09
  • There is one extreme workaround I can think off, but it is not a practical solution: alias commands to their full file_paths and unset PATH variable. `alias ls=/bin/ls`,`alias mkdir=/bin/mkdir`,... and so on, and finally `BACKUP_PATH="$PATH"; unset PATH`. However, this needs to be done only for those commands that are used by the build process **AND** taken from the PATH. if it isn't used by the build process, the alias is not necessary. Now `cd ndkfoo; $NDK_ROOT/ndk_build`and it **should** work. To restore the path (**if** this method works out), do `export PATH="$BACKUP_PATH"` and it's back. – Samveen May 25 '12 at 05:21
  • i just couldnt get anything to work on my mac so i shifted the complete setup on linux ,,and it worked ,,, dont kw is there some prob with mac ,,,but it is working on linux so i started my dev on that ,,thnks 4 ur response,,, – Amit Hooda May 28 '12 at 05:00
  • Possible duplicate of [Your APP_BUILD_SCRIPT points to an unknown file using Android ndk-build](https://stackoverflow.com/q/6494567/608639) – jww Aug 26 '18 at 03:14

1 Answers1

1

quoted from this source: https://groups.google.com/forum/#!topic/android-ndk/HIUR2gL6Xj0

The build system tries to find your AndroidManifest.xml by back-tracking directories. It looks like it found one under /home/myhome/AndroidManifest.xml and thinks this is the root of your project path. I assume this corresponds to another (possibly stale) project, not the one you want to work on.

Try invoking ndk-build from the directory containing your AndroidManifest.xml instead

I think you have a similar problem here.

sschrass
  • 7,014
  • 6
  • 43
  • 62
  • Thanks for your response,,,but in that case the path would hav been the path to that AndroidManifest.xml but here it gives a wierd kind of path Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Users/naveenkumar/workspace/com.gslab.zap:/Users/naveenkumar/Android/android-ndk-r8:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/naveenkumar/Android/android-ndk-r8:/usr/X11/bin:/usr/local/git/bin/jni/Android.mk i tried doing this but it doesnt work :( – Amit Hooda May 23 '12 at 08:33