3

While trying to create a shared library using android-ndk-r8b it shows the error

Your APP_BUILD_SCRIPT points to an unknown file /home/myLib/ndk1/jni/Android.mk 
Android NDK Aborting...    .Stop

For my application,I simply created a jni folder which contains a ndk1.c file and Android.mk file

Steps for building library:

export ARM_ROOT=/home/myLib/android-ndk-r8b
    export ARM_TOOL=/home/myLib/android-ndk-r8b/toolchains/arm-linux-androideabi-   
4.4.3/prebuilt/linux-x86
    export ARM_LIB=/home/myLib/android-ndk-r8b/platforms/android-8/arch-arm/usr/lib
    export ARM_LIBO=/home/myLib/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3
    export ARM_INC=/home/myLib/android-ndk-r8b/platforms/android-8/arch-arm/usr/include
    export ARM_PRE=arm-linux-androideabi
    export NDK=/home/myLib/android-ndk-r8b 
    export PATH=$PATH:/home/myLib/android-ndk-r8b
    export NDK_PROJECT_PATH=/home/myLib/ndk1

Please help with your valuable suggestions!!

2 Answers 2

4
+50

This is a very good tutorial for ndk beginners http://marakana.com/forums/android/examples/49.html

In tutorial : as you are building on android-ndk-r8b replace step which says

go to  your NDK-HOME and  run  make APP=ndk_demo

do this

go to your android project directory and run ndk-build in terminal

Checklist

1) Make sure path NDK path is set

2) Make sure you generated the header file and moved to jni folder

3) You copied appropriate function signature from the header file to your c file this a place people make mistakes while referring to examples they blindly copy the function signature while using some other package name and class name.

JNIEXPORT jint JNICALL Java_com_your_package_class_method(JNIEnv *d, jobject e, jstring f);

4)Make file is present inside your jni folder and contains the correct c file name

5)You are running ndk-build in correct directory ,i.e., project home directory

Sign up to request clarification or add additional context in comments.

Comments

1

try verbose with the "ndk-build".... So you can follow step-by-step what the build is doing with the instructions in the .mk

ndk-build -B V=1

use above for more details ....

2 Comments

Thanks for the reply. can you please explain the ndk-build step that you mentioned? Since i'm a beginner in building shared library.
where did u install the NDK? read all the html files in $ $NDK/docs directory. if you are not familiar with the discreet steps , you can read about them in the GNU documentation ( CC, LD, NM, AR )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.