NDK build error
Asked Answered
E

7

6

Hi I am new to Android NDK Development.

MacBook-Pro:JNIexample sk$ ndk-build
usage: dirname path
gmake: /Users/sk/build/core/build-local.mk: No such file or directory
gmake: *** No rule to make target `/Users/sk/build/core/build-local.mk'.  Stop.

Why do I get his error?

Eskew answered 8/2, 2011 at 20:35 Comment(0)
U
14

So I was having the same trouble, and it looks like if I have any directory which is a part of full dir-path which has dir-name with space (' ') in between then 'ndk-build' wont be able to resolve paths. So my directory name "development tools" wasnt good enough so I changed it to "developmenttools" and it worked. If I hard-code the path in 'ndk-build' then it was working so found out the reason.

Unreliable answered 19/4, 2011 at 7:40 Comment(0)
P
1

You need to specify the project you want to build. Like this: ndk-build -C location_of_project.

For example, to build the hello-neon sample that comes with the NDK you would go to your ndk install root and do ndk-build -C samples/hello-neon

Priapism answered 8/2, 2011 at 20:43 Comment(2)
MacBook-Pro:~ sk$ ndk-build -C /Users/sk/Desktop/JNIExample/jni/ usage: dirname path gmake: Entering directory /Users/sk/Desktop/JNIExample/jni' gmake: /Users/sk/build/core/build-local.mk: No such file or directory gmake: *** No rule to make target /Users/sk/build/core/build-local.mk'. Stop. gmake: Leaving directory `/Users/sk/Desktop/JNIExample/jni' NOTE: The jni folder contains the Application.mk fileEskew
Try ndk-build -C /Users/sk/Desktop/JNIExample/Priapism
D
1

The ndk-build tool is actually just a wrapper that calls gmake with the build-local.mk file. It finds the build-local.mk file by creating a relative path rooted at the location of the ndk-built tool. Sounds like you don't have the full NDK installed, or maybe moved the ndk-build tool without moving the rest of the NDK contents?

Drislane answered 26/2, 2011 at 3:21 Comment(2)
I didn't move any of the tools. Just followed the instructions on the website.Eskew
Sounds like the ndk-build isn't finding the local build script for some reason however. I assume /Users/sk/build/core/build-local.mk is present and readable? Try putting some debugging in ndk-build to figure out what's throwing it off. Without some more info I don't have any other suggestions however.Drislane
M
0

I also faced this problem. And i solved it and post entire answer here. I hope it helps you.

Misanthrope answered 11/1, 2013 at 8:39 Comment(0)
H
0

Please notice that from the error message: gmake: /Users/sk/build/core/build-local.mk: No such file or directory.

The build/core/builid-local.mk is actually in the ndk's root directory, why is it listed as the /Users/username/build…?

I've encountered the same error on my Macbook. I've put the ndk inside /Applications/Android Studio.app directory, since there is a space between the name, somehow the tool in ndk can't resolve the implied path. That's why the error message is printed.

Later I renamed Android Studio.app to Android-Studio.app and thus resolved the issue.

Hurff answered 30/1, 2014 at 12:0 Comment(0)
R
0

The solution for me was different. If you look in the ndk-build script, you see it immediately runs `dirname $0` to get the directory to work in.

I was calling "ndk-build" from my command line, which was using a copy of the ndk-build script that I had put in /usr/local/bin/ and so my error was '/usr/local/bin/build/core/build-local.mk: No such file or directory'.

The solution is to be in the ndk folder where the real ndk-build script lives, and use the -C /path/to/project option to tell it where to start. So, 'cd /path/to/ndk' and then run './ndk-build -C /path/to/project'

Rampant answered 21/9, 2014 at 4:7 Comment(0)
S
0

I was having same problem. I created new workspace and import existing project to it. But forgot to add ndk location in windows->preferences->Android->NDK.

Stairhead answered 24/5, 2016 at 17:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.