title: How can i implement two JNI methods with same name but different Params?
body: <p>I have a java class with two native functions with same names but different parameters.</p>
  
  <pre><code>package com.example;
  
  public class Test {
  
      static {
          System.loadLibrary("TestLib");
      }
  
      public static native void doSomething(int a);
      public static native void doSomething(int a, long b);
  }
  </code></pre>
  
  <p>My header file looks like</p>
  
  <pre><code>#include &lt;jni.h&gt;
  
  #ifndef _TEST_LIB_H_
  #define _TEST_LIB_H_
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  JNIEXPORT void JNICALL Java_com_example_Test_doSomething
      (JNIEnv *env, jclass clazz, jint a);
  
  JNIEXPORT void JNICALL Java_com_example_Test_doSomething
      (JNIEnv *env, jclass clazz, jint a, jlong b);
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif //_TEST_LIB_H_
  </code></pre>
  
  <p>and my cpp file</p>
  
  <pre><code>#include "TestLib.h"
  
  JNIEXPORT void JNICALL Java_com_example_Test_doSomething
      (JNIEnv *env, jclass clazz, jint a){
      Java_com_example_Test_doSomething(env, clazz, a, -1);
  }
  
  JNIEXPORT void JNICALL Java_com_example_Test_doSomething
      (JNIEnv *env, jclass clazz, jint a, jlong b) {
      // implementation
  }
  </code></pre>
  
  <p>with only one function it works, but after add a second one with same name and different parameters I get an error: </p>
  
  <pre><code>error: conflicting declaration of C function 'void Java_com_example_Test_doSomething(JNIEnv*, jclass, jint, jlong)'
  note: previous declaration 'void Java_com_example_Test_doSomething(JNIEnv*, jclass, jint)'
  </code></pre>
  
  <p>I'm using android studio and experimental gradle plugin.
  What am I doing wrong?</p>