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
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.
10 Answers Android Studio 2.2 installs it in C:\Users\[username]\AppData\Local\Android\Sdk\ndk-bundle (on Windows 10).
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.
You can use the following command
ndk-build -C your_project_path
Hope this will answer your question.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With