NDK no such directory or file error
<p>I am trying to compile <code>.so</code> files in Android, first issue is when I directly use <code>gradle</code> it runs perfectly but no <code>.so</code> files are generated, so I resorted to calling <code>ndk</code> by myself, I made a few changes to my <code>gradle.build</code> file now it looks like my `:</p>

<pre><code>apply plugin: 'com.android.application'
import org.apache.tools.ant.taskdefs.condition.Os

android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
    applicationId "nemo.lungu.receiptor"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled false


    ndk
            {
                moduleName "Scanner"
                stl "stlport_shared"
            }
}
sourceSets.main {
    jniLibs.srcDir 'src/main/libs' //set .so files location to libs
    jni.srcDirs = [] //disable automatic ndk-build call
}

// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine 'ndk-build.cmd', '-C', file('src/main').absolutePath
    } else {
        commandLine 'ndk-build', '-C', file('src/main').absolutePath
    }
}
tasks.withType(JavaCompile) {
    compileTask -&gt; compileTask.dependsOn ndkBuild
}


buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
</code></pre>

<p>}</p>

<p>When I compile my code it just gives me an error to say <code>ndk</code> encountered an error so I resorted to method 3; compiling the <code>.so</code> files manually, my <code>Android.mk</code> files looks like this: </p>

<pre><code>LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
include .../sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := Scanner

LOCAL_SRC_FILES := scan.cpp
LOCAL_LDLIBS    += -lm -llog -landroid
LOCAL_LDFLAGS += -ljnigraphics
include $(BUILD_SHARED_LIBRARY)
</code></pre>

<p>and <code>Application.mk</code> looks like:</p>

<pre><code>APP_STL := stlport_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-15
</code></pre>

<p>My new error now that it cannot find <code>sdk/native/jni/OpenCV.mk</code>, am running ndk from cmd as follows</p>

<ol>
<li>Open cmd and navigate to ndk directory</li>
<li>run the <code>ndk-build NDK_PROJECT_PATH=full/path/to/project APP_BUILD_SCRIPT=full/path/to/project/Android.mk</code> so if my project is <code>Mario</code>in root of my C directory it would be <code>C:/mario/</code> </li>
</ol>

<p>Anyone have an idea on how I can get passed this error?</p>