4

I am developing an android application on using Android Studio on Windows 8 and I am using some native code. All of a sudden I can't compile the my C files. When I am running ndk-build I am getting the following error:

process_begin: CreateProcess(NULL, uname -a, ...) failed.
process_begin: CreateProcess(NULL, uname -r, ...) failed.
The system cannot find the path specified.
'mount' is not recognized as an internal or external command,
operable program or batch file.

I'm really frustrated since I haven't really messed with anything and both android-sdk and android-ndk seem to be in my PATH.

Any help would be really appreciated! Thank u

asked Feb 2, 2015 at 17:07
7
  • You probably installed something that has messed up with your environmental parameters. Not very scientific, but the easiest way typically is to try uninstalling and setting up Android Studio and NDK all over again to make sure they overwrite the environmental values that has been modified. I hope it solves your problem! Commented Feb 2, 2015 at 17:47
  • Just did that and it's still the same... Do you have any idea what might be causing it? What is missing from the path, so maybe I can add it manually? Commented Feb 2, 2015 at 20:21
  • NDK path is the only thing that I can think of. But you said you have already checked that one. Unfortunately, I have no other guess... Commented Feb 2, 2015 at 21:24
  • go back to ndk samples in root/samples where you install the ndk. See whether you can follow the sample builds on those projects using the Command line as per ndk samples. "uname" is a linux system shell cmd not windows. where could that have come from? I would use a VM for ndk if on windows OS. Commented Feb 2, 2015 at 23:56
  • Did you specified ANDROID_NDK_HOME or put ndk.dir=C:\\ndk in local.properties. Is your .c files inside of jni folder? Commented Feb 13, 2015 at 12:33

3 Answers 3

2

I think that somewhere you are clearly targeting the wrong architecture for your NDK build-chain.

I suppose that in your error-log you can see something like this:

Android NDK: Unable to determine HOST_OS from uname -s: 
Android NDK: Please define HOST_OS in your environment.
...
process_begin: CreateProcess(NULL, uname -s, ...) failed.

Under Windows you can try to use the command ndk-build.cmd instead of ndk-build, as suggested here.

answered Feb 8, 2015 at 17:40
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, unfortunately this is not the case here, I tried ndk-build.cmd but didn't help
1

When I had this problem the cause was some whitespace sneaking into my makefile between a line continuation ('\') and the newline. That is apparently utterly and cryptically unacceptable to Android Studio.

Have a look for any extra spaces/tabs or line-ending inconsistencies that an editor may have 'helpfully' (but invisibly) added to the makefile.

You don't need to have changed anything for this to creep in. In some cases just opening it in the wrong text editor will cause the file to change. In others, a simple seeming copy and paste will also add unwanted format adjustment.

answered Jan 10, 2019 at 14:24

Comments

0

If you change the OpenCV.mk to your target platform such as OpenCV-x86.mk in the Android.mk file, then it will work.

answered Feb 2, 2017 at 4:42

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.