NDK can't find the application directory

2019-01-21 04:30发布

When running the ndk-build command I get the following error:

Android NDK: Could not find application project directory !    
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.

The contents of my Android.mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := FRE
LOCAL_SRC_FILES := FlashRuntimeExtensions.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := NativeQCAR
LOCAL_SRC_FILES := main.c
LOCAL_SHARED_LIBRARIES := FRE
include $(BUILD_SHARED_LIBRARY)

Adding the following line doesn't help:

NDK_PROJECT_PATH = C:/Users/Wessel/Dropbox/workspace/eclipse/NativeQ

11条回答
孤傲高冷的网名
2楼-- · 2019-01-21 05:02

-C worked for me.

enter image description here

You can also use the mac terminal to do this.

查看更多
smile是对你的礼貌
3楼-- · 2019-01-21 05:04

You need to follow steps below:

1.Go to folder containing Android.mk

2.Assign the android-ndk path to $NDK_PROJECT_PATH. eg: export NDK_PROJECT_PATH =/home/android-ndk-r8b.

3.Add NDK to $PATH. eg: export PATH=$PATH:/home/android-ndk-r8b.

查看更多
我只想做你的唯一
4楼-- · 2019-01-21 05:07

You can use the following command

ndk-build -C your_project_path

Hope this will answer your question.

查看更多
等我变得足够好
5楼-- · 2019-01-21 05:13

NDK_PROJECT_PATH is an environment variable so you don't have to include in the Android.mk file. Is nkd-build launched in the project directory?

For more info read the docs in docs/HOWTO.html in the NDK folder where I read

Starting with NDK r4, you can simply place the file under $PROJECT/jni/ and launch the 'ndk-build' script from your project tree.

If you want to use 'ndk-build' but place the file to a different location, use a GNU Make variable override as:

ndk-build NDK_APPLICATION_MK=/path/to/your/Application.mk
查看更多
兄弟一词,经得起流年.
6楼-- · 2019-01-21 05:17

Set your ndk builder's working directory could solve your problem as I got the same problem and solved it in this way.

Path: Project Properties -> Builders -> -> Main -> Working Directory

查看更多
登录 后发表回答