2

I am trying to use mupdf for Android.I have installed the ndk from Android Studio Settings.I have also updated my PATH varibale in System variables.But when I type ndk-build in git bash or cygwin I get error:- $ ndk-build bash: ndk-build: command not found.Can anyone guide me?

When I run C:\android-ndk-r12\ndk-build.cmd I get the following warnings and errors.

Android NDK: WARNING: APP_PLATFORM android-24 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml Android NDK: WARNING:jni/Android.mk:mupdfcore: LOCAL_LDLIBS is always ignored for static libraries [armeabi-v7a] "Compile thumb ": "mupdf_java <= mupdf.c" process_begin: CreateProcess(NULL, C:/android-ndk-r12/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc -MMD -MP -MF ./obj/local/armeabi-v7a/objs/mupdf_java/mupdf.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -g -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -Os -DNDEBUG -Ijni/andprof -I../../../include -I../../../source/fitz -I../../../source/pdf -I../../../platform/java -IC:/android-ndk-r12/build//../sources/cxx-stl/system/include -Ijni -DANDROID -DHAVE_ANDROID -Wa,--noexecstack -Wformat -Werror=format-security -isystem C:/android-ndk-r12/build//../platforms/android-24/arch-arm/usr/include -c jni/mupdf.c -o ./obj/local/armeabi-v7a/objs/mupdf_java/mupdf.o, ...) failed. make (e=2): The system cannot find the file specified. make: *** [obj/local/armeabi-v7a/objs/mupdf_java/mupdf.o] Error 2

Any help or suggestion is appreciated?

3
  • how have you updated the path ? Commented Jul 11, 2016 at 7:39
  • I edited the Path variable text C:\Users\AndroidNewBee\AppData\Local\Android\sdk\ndk-bundle\ndk-build. Commented Jul 11, 2016 at 7:45
  • edited how? That format is NOT the cywin posix style; look on echo $PATH for checking. Commented Jul 11, 2016 at 9:18

2 Answers 2

2

First of all, you don't need ndk-build on your PATH. You can invoke it from command line like this:

C:/Users/AndroidNewBee/AppData/Local/Android/sdk/ndk-bundle/ndk-build

If this does not work, check where you actually unpacked your NDK. It is very important to avoid directories with space in their names, e.g. Application Data or whatever.

Second, you don't need cygwin or bash to run ndk-build. You can run it from your Windows CMD window, as

C:\Users\AndroidNewBee\AppData\Local\Android\sdk\ndk-bundle\ndk-build.cmd

If you want to set your PATH to make invocation of ndk-build easier, you need to add the folder that contains the command, not the command itself, e.g.

PATH=%PATH%;C:\Users\AndroidNewBee\AppData\Local\Android\sdk\ndk-bundle
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks Alex. Please check my updated question. I get these warnings Android NDK: WARNING: APP_PLATFORM android-24 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml Android NDK: WARNING:jni/Android.mk:mupdfcore: LOCAL_LDLIBS is always ignored for static libraries [armeabi-v7a] "Compile thumb ": "mupdf_java <= mupdf.c"
I believe that your update qualifies as a whole new question.
The warning says exactly what it is about. Your Application.mk should include APP_PLATFORM:=android-8 if you really need android:minSdkVersion 8. You can also provide APP_PLATFORM=android-8 on ndk-build command line if it better suits your environment
Regarding the error, check if file C:\android-ndk-r12\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-gcc.exe exists. Maybe, you will find arm-linux-androideabi-gcc.exe under windows, see stackoverflow.com/questions/37928061. In this case, you should download the fixed Win-64 NDK.
0

I was encountering the Command not found when navigating to ndk folder, Hence tried with the full path and escaping slash '\' it worked!

*Saad@DESKTOP-L2341JS MINGW64 /E/dev/android_sample_master/app/jni*
$ D:\\sdk\\ndk-bundle\\ndk-build.cmd Android.mk

Comments

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.