How to build and debug native code (c) with neon enabled in android studio?
<p>I am referring <a href="https://stackoverflow.com/questions/28307481/is-it-possible-to-debug-c-c-in-android-studio?lq=1">is-it-possible-to-debug-c-c-in-android-studio?</a> last answer by Yuchen Zhong  and did some basic example also, that I am able to build and debug also. </p>

<p>So now I am trying with my old app project to do same thing. My old app buil.gradle is </p>

<pre><code>apply plugin: 'com.android.application'
android {
    compileSdkVersion 18
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "pku......"
        minSdkVersion 9
        targetSdkVersion 17

        sourceSets.main {
            jni.srcDirs = []
            jniLibs.srcDir 'C:/Users/Admin/AndroidStudioProjects/and..../app/src/main/libs'
        }

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            ndk {
               debuggable = true
            }
        }
        debug {
              debuggable = true
              jniDebuggable = true
        }
        debug {
            jniDebuggable true
        }
    }
}
</code></pre>

<p>Updated build.gradle is follow so I will able to debug my code through android studio.</p>

<pre><code>apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion  = "23.0.1"

        defaultConfig.with {
            applicationId = "pku........"
            minSdkVersion.apiLevel = 18
            targetSdkVersion.apiLevel = 23
            versionCode = 1
            versionName = "1.0"
            //sourceSets.main {
            //    jni.srcDirs = []
            //    jniLibs.srcDir 'C:/Users/Admin/AndroidStudioProjects/andh...../app/src/main/libs'
            //}
        }
    }
    android.buildTypes {
        release {
            minifyEnabled = false
            proguardFiles.add(file('proguard-android.txt'))
        }
    }

   android.ndk {

        abiFilters.add("armeabi-v7a")
        moduleName = "icandroid"
        //CFlags.add("-std=c99")
        //CFlags.add("-mfloat-abi=soft")
        //CFlags.add("-mfpu=neon")
        CFlags.addAll(["-std=c99 ", "-mfloat-abi=softfp", "-mfpu=neon", "-O3", "-DCARES_STATICLIB", "-Wno-c++11-long-long"])
        stl = "stlport_shared" // stlport_shared, gnustl_static, "system"

    }

}

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

<p>But while build I got the error</p>

<blockquote>
  <p>prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9\include\arm_neon.h
  Error:(31, 2) error: #error You must enable NEON instructions (e.g.
  -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h</p>
</blockquote>

<p>I don't know how to solve this problem because I have mentioned cflag also.  </p>

<p>Please help me to solve this error and if there are some more error then also correct me. </p>