可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I get the following error while trying to compile an Android NDK project:
ndk-build Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /home/lambergar/work/APIExample/jni/Android.mk /home/lambergar/android/ndk/android-ndk-r5c/build/core/add-application.mk:116: *** Android NDK: Aborting... . Stop.
The weird thing is, that the 'unknown file' (Android.mk) exists under the path reported as invalid.
回答1:
Same problem (in Windows 7) but the cause is different.
After searching in the Environment parameters, I've found the evil thing named "NDK_PROJECT_PATH" which has value is an invalid path.
Deleted it and things are working again ;)
回答2:
I just had the same problem. I fixed it by creating a Application.mk in $NDK/apps/ndktestapp with following content:
APP_PROJECT_PATH := /cygdrive/c/workspace/MyApp
and then calling
make APP=ndktestapp
from the NDK-Root. Hope that helps.
回答3:
In my case the problem was with white spaces in the project path. In such case, change the project path folders and import the project again.
回答4:
I solved the problem by adding a new build to the project and voila, it works... Don't know what was the problem with the CLI build though.
回答5:
You need to set the env variable NDK_PROJECT_PATH
to the root of the project you are building. The root of your NDK project will typically contain the ./jni
directory.
export NDK_PROJECT_PATH={root_of_project}
If your JNI code is in a library, then set NDK_PROJECT_PATH
to the library project.
回答6:
Just saw this problem today. In my case actual problem was spaces inside path to project.
(yes, ndk-build
will not compile your project if you have spaces inside folder name)
回答7:
Just spent an hour or two trying to figure this one out. Many, many people have had this problem. But as I found out I actually did not have a file name Android.mk it was named Andriod.mk and that was enough to cause me a lot of trouble. Sorry about my original rant but that was the whole problem in the end. I suggest if you have this problem you should check everything until you find something wrong.
This fixed me right up. Thanks guys you put me on the right track anyway.
Phyll
回答8:
as the same as @phavens, i think that only wrong with the word Android.mk and android.mk file, just spent for 5 minutes .. hehe
回答9:
I just installed Android-NDK and tried "ndk-build". I had exactly the same error. Here is how I beat it.
bash export NDK_PROJECT_PATH={root_of_android_ndk}/samples/hello-jni ./ndk-build
This worked.
回答10:
Inside Android.mk file, you give the path where the jni folder loacted... in your case ARTOOLKIT_DIR :=/home/lambergar/work/APIExample/
回答11:
Gradle Experimental plugein in Android Studio add support for Native project build.
回答12:
in my case the project folder name had a space in it removed the space re imported it to Android Studio and that solved the problem