2
votes

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?

2
how have you updated the path ?Shubhank
I edited the Path variable text C:\Users\AndroidNewBee\AppData\Local\Android\sdk\ndk-bundle\ndk-build.AndroidNewBee
edited how? That format is NOT the cywin posix style; look on echo $PATH for checking.matzeri

2 Answers

2
votes

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
0
votes

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