title: Android Studio NDK C++11 use of undeclared identifier 'nullptr' Error is Not was not declared in this scope
body: <p>I am using Android Studio 2.1.2 and I am not using Experimental Plugin for NDK.</p>
  
  <p>I need to compile C++11 source into Android application.</p>
  
  <p>I am done with all NDK setup done with sample JNI and NJI communication.</p>
  
  <p>Now I need to try new keywords or features added in C++11 with Android.</p>
  
  <p>Please check following files, and error I am getting.</p>
  
  <p>I fixed the issue. I am editing files with working code. And the question is not duplicate.</p>
  
  <p>HelloJni.cpp</p>
  
  <pre><code>char *pc = nullptr;     // OK
  int  *pi = nullptr;     // OK Checking C++11
  </code></pre>
  
  <p>Application.mk</p>
  
  <pre><code>    APP_ABI := all
      APP_STL    := gnustl_static
      APP_CFLAGS += -std=gnu++11
      APP_OPTIM  := debug
      LOCAL_CPP_FEATURES += exceptions
      NDK_TOOLCHAIN_VERSION := 4.9
  </code></pre>
  
  <p>Android.mk</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE := ndksampleapp
  LOCAL_SRC_FILES := HelloJni.cpp
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>android {
      compileSdkVersion 23
      buildToolsVersion "24.0.1"
  
      defaultConfig {
          applicationId "com.example.m1035325.ndksampleapp"
          minSdkVersion 15
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      sourceSets.main {
          //jniLibs.srcDirs = [ 'src/main/libs' ]
          jniLibs.srcDir 'src/main/libs'
          jni.srcDirs = []
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.4.0'
  }
  </code></pre>
  
  <p>I am getting following error</p>
  
  <pre><code>Warning:Native C/C++ source code is found, but it seems that NDK option is not configured.  Note that if you have an Android.mk, it is not used for compilation.  The recommended workaround is to remove the default jni source code directory by adding:
   android {
      sourceSets {
          main {
              jni.srcDirs = []
          }
      }
  }
  to build.gradle, manually compile the code with ndk-build, and then place the resulting shared object in src/main/jniLibs.
   char *pc = nullptr;     // OK
              ^
  C:\Users\AndroidStudioProjects\NDKSampleApp\app\src\main\jni\HelloJni.cpp
  Error:(10, 12) error: 'nullptr' was not declared in this scope
  Error:(11, 12) error: 'nullptr' was not declared in this scope
   int  *pi = nullptr;     // OK Checking C++11
              ^
  make: *** [C:\Users\AndroidStudioProjects\NDKSampleApp\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/app/C_\Users\AndroidStudioProjects\NDKSampleApp\app\src\main\jni\HelloJni.o] Error 1
  :app:compileDebugNdk FAILED
  Error:Execution failed for task ':app:compileDebugNdk'.
  &gt; com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd'' finished with non-zero exit value 2
  Information:BUILD FAILED
  </code></pre>
  
  <p>Error is fixed. Now I am able to compile C++11 cpp code with Android NDK.
  Please refer the edited files above.</p>