title: Android Studio NDK project changing CMakeLists.txt path causes error (unable to find Ninja)
body: <p>I have a native android project structure using CMake in Android Studio. I want to change the path of my CMakeLists.txt file in build.gradle which is by default <code>src/main/cpp/CMakeLists.txt</code> to <code>D:/Projects/AndroidNative/CMakeLists.txt</code></p>
  
  <p>After doing this change my build.gradle looks like this:
  (Relevant part in "externalNativeBuild" scope)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion '25.0.0'
      defaultConfig {
          applicationId "com.myproject.andndk"
          minSdkVersion 15
          targetSdkVersion 23
  
          ndk {
              abiFilters 'x86', 'armeabi', 'armeabi-v7a'
          }
  
          externalNativeBuild {
              cmake {
                  arguments '-DANDROID_PLATFORM=android-15',
                          '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static'
              }
          }
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      externalNativeBuild {
          cmake {
              path 'D:/Projects/AndroidNative/CMakeLists.txt'
          }
      }
      sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:23.4.0'
      compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
  }
  </code></pre>
  
  <p>So when I sync my gradle project I have this error:</p>
  
  <pre><code>  The detected version of Ninja () is less than the version of Ninja required
  </code></pre>
  
  <p>I do have a Ninja installed and up to date, obviously because I did not have this error before changing CMakeLists path. So I don't understand why it can no longer find Ninja ?</p>
  
  <p>Here is the CMake command generated:</p>
  
  <pre><code>Error while executing process
  C:\Users\xxxx\AppData\Local\Android\sdk\cmake\3.6.4111459\bin\cmake.exe
  with arguments {-HD:\Projects\AndroidNative
  -BC:\Users\xxxx\AndroidStudioProjects\andndk\app\.externalNativeBuild\cmake\release\armeabi-v7a
  -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi-v7a -DANDROID_NDK=C:\Users\xxx\AppData\Local\Android\sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\xxxx\AndroidStudioProjects\andndk\app\build\intermediates\cmake\release\obj\armeabi-v7a
  -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=C:\Users\xxxx\AppData\Local\Android\sdk\cmake\3.6.4111459\bin\ninja.exe
  -DCMAKE_TOOLCHAIN_FILE=C:\Users\xxxx\AppData\Local\Android\sdk\ndk-bundle\build\cmake\android.toolchain.cmake
  -DANDROID_PLATFORM=android-15 -DANDROID_PLATFORM=android-15 -DANDROID_TOOLCHAIN=clang -DANDROID_STL=gnustl_static}
  </code></pre>