How to set NDK_PROJECT_PATH in Android Studio
<p>I am very new to NDK debugging and I am trying to build the cpp code for debugging.</p>

<p>This is how my Application.mk file looks :</p>

<pre><code>APP_STL := stlport_static
APP_MODULES := abc xyz
APP_CFLAGS += -fno-rtti -fexceptions
APP_ABI := armeabi armeabi-v7a
NDK_TOOLCHAIN := arm-linux-androideabi-4.9
</code></pre>

<p>and I an getting the following error , I have tried all the toolchains in ndk tools , what am I missing ?</p>

<p><a href="https://i.stack.imgur.com/mHjvD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mHjvD.png" alt="enter image description here"></a></p>

<p>update:
 I realized that NDK_PROJECT_PATH is set to null , when built is run from Android studio. I am able to run</p>

<p>ndk-build -C  from the terminal.</p>

<p>Actually my ultimate aim is to be able to debug native c++ files , by setting break points.</p>

<p>So current scenario:
I have native code in xyz folder with has jni folder containing android.mk and application.mk</p>

<p>I can run ndk-build in this folder and get the .so files, which I manually copy paste in jnilibs folder of the my android app (say appB):</p>

<p>This is the gradle of the appB :</p>

<pre><code>apply plugin: 'com.android.library'

android {

    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        minSdkVersion 13
        targetSdkVersion 13
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    //compile 'junit:junit:4.12'
    // compile 'com.android.support:appcompat-v7:24.1.1'
}
</code></pre>

<p>Later I use this app as dependency in another app say appA.</p>

<p>This is the gradle of appA:</p>

<pre><code>buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
    }
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "*****"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories{
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:support-v4:24.0.0'
    compile 'com.android.support:recyclerview-v7:24.0.0'
    compile 'com.android.support:cardview-v7:24.0.0'
    compile 'com.android.support:preference-v14:24.1.0'
    compile project(':appB')
}
</code></pre>

<p>I need to be able to debug, 
appA (which I can)
appB (which I can)
native code included as .so in appB (which I dont know yet how to)
aap</p>