title: Configuring Android Studio to use NDK (android-ndk-r10d, Windows 64-bit)
body: <p>I have an application I'm trying to compile, which uses *.c files.</p>
  
  <p>To compile this I must use NDK.</p>
  
  <p>Downloaded the 64bit version and browsed the net to find tips on configuring gradle.</p>
  
  <p>It seems the config is ok, and gradle attempts to run the NDK build process.</p>
  
  <p>It does this by calling ndk-build.cmd and stops with this error:</p>
  
  <blockquote>
    <p>\AppData\Local\VirtualStore\Windows\SysWOW64\android-ndk-r10d\ndk-build.cmd": CreateProcess error=2, The system cannot find the file specified</p>
  </blockquote>
  
  <p>I searched the whole folder for ndk-build.cmd, but there is none.</p>
  
  <p>What in the world am I missing?</p>
  
  <p>EDIT1: The NDK is installed here:</p>
  
  <pre><code>#ndk.dir=C\:\\Users\\user\\AppData\\Local\\VirtualStore\\Windows\\SysWOW64\\android-ndk-r10d
  </code></pre>
  
  <p>EDIT2: I did try my system path is OK, this is not the problem. I did however instal the 32-bit version, and this one does have the *.cmd file. </p>
  
  <p>I can now compile the *.c files.</p>
  
  <p>I used this command in the AndroidStudio Terminal:</p>
  
  <pre><code>ndk-build -C C:\Users\Thatisme\AndroidStudioProjects\DeezerAP2\app\src\main\jni
  </code></pre>
  
  <p>All *.c, *.h, *.mk and *.sh were placed in the jni folder as seen in the picture bellow.</p>
  
  <p>EDIT3: I can now generate *.so files, but for some reason, the native methods are not found.</p>
  
  <p>EDIT4:</p>
  
  <p>This is how my project looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/myNej.jpg" alt="enter image description here"></p>
  
  <p>I manually copied the *.so files in the jniLibs folder.</p>
  
  <p>Is the declaration of the *.c function OK?</p>
  
  <pre><code>JNIEXPORT jobject JNICALL Java_com_lexample_liggy_ldeezerap_SerialPort_open
    (JNIEnv *env, jclass thiz, jstring path, jint baudrate, jint flags)
  </code></pre>
  
  <p>EDIT5: I finally did it. The correct name of the function is:</p>
  
  <pre><code>JNIEXPORT jobject JNICALL Java_com_example_iggy_deezerap_SerialPort_open
    (JNIEnv *env, jclass thiz, jstring path, jint baudrate, jint flags)
  </code></pre>
  
  <hr>
  
  <pre><code>Package name is: com.example.iggy.deezerap
  Java file calling the function "open()" is: SerialPort
  The source file containing the native function is named: SerialPort.c
  The function beeing called is: open()
  </code></pre>
  
  <p>I recompiled the *.c files, copied them also in jniLibs, recompiled the Android project and now it works.</p>
  
  <p>I'm pretty sure I had this before and I strongly suspect it was due to some sort of mismatch error in the *.c functions.</p>
  
  <p>About the thing in <strong>bold</strong>:</p>
  
  <p>JNIEXPORT jobject JNICALL Java_com_example_iggy_deezerap_<strong>SerialPort</strong>_open
        (JNIEnv *env, jclass thiz, jstring path, jint baudrate, jint flags)</p>
  
  <p>Does this refer to the *.c file or the *.java file?</p>