Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NDK can't find the application directory

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 
like image 662
Wessel van der Linden Avatar asked Jan 04 '13 11:01

Wessel van der Linden


People also ask

Where can I find NDK directory?

Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.

Where is android NDK installed Windows 10?

10 Answers Android Studio 2.2 installs it in C:\Users\[username]\AppData\Local\Android\Sdk\ndk-bundle (on Windows 10).

What is Ndk_project_path?

NDK_PROJECT_PATH - the location of your project NDK_APPLICATION_MK - the path of the Application.mk file APP_BUILD_SCRIPT - the path to the Android.mk file. These are needed to override the default values of the build script, which expects things to be in the jni folder.


2 Answers

You can use the following command

ndk-build -C your_project_path 

Hope this will answer your question.

like image 106
Sachini Samarasinghe Avatar answered Oct 02 '22 11:10

Sachini Samarasinghe


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 
like image 41
gipi Avatar answered Oct 02 '22 10:10

gipi