title: Native method not found: com.example.pjtest.JniClass.get_time:()C
body: <p>I am trying creating simple jni but app is crashing .I am not able to find the mistake I have done .Here is my code :</p>
  
  <p><strong>Example.c</strong></p>
  
  <pre><code> #include &lt;time.h&gt;
   double My_variable = 3.0;
  
   int fact(int n) {
       if (n &lt;= 1) return 1;
       else return n*fact(n-1);
   }
  
   int my_mod(int x, int y) {
       return (x%y);
   }
  
   char *get_time()
   {
       time_t ltime;
       time(&amp;ltime);
       return ctime(&amp;ltime);
   }
  </code></pre>
  
  <p><strong>Android.mk</strong></p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := example
  LOCAL_CFLAGS    := -Werror
  LOCAL_SRC_FILES := example.c
  LOCAL_LDLIBS    := -llog 
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>After this I have build the folder using NDK.Files generated in lib is <strong>libexample.so</strong>.And <strong>example.o</strong> ,<strong>example.o.d</strong> in obj folder.when I load lib by name <strong>example</strong> it is giving error while calling method only but when I load by name l*<em>ibexample</em>* it is giving error while loading lib as well as while calling method.</p>
  
  <p><strong>JNI</strong></p>
  
  <pre><code>package com.example.pjtest;
  
      public class JniClass {
  
        public final static native char get_time();
      }
  </code></pre>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>package com.example.pjtest;
  
  import android.app.Activity;
  import android.os.Bundle;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          try {
              System.loadLibrary("example");
          } catch (UnsatisfiedLinkError e) {
              e.printStackTrace();
          }
          try{
          System.out.print(JniClass.get_time());
          }
          catch(Exception e )
          {
              e.printStackTrace();
          }
  
      }
  }
  </code></pre>
  
  <p><strong>Here is log :</strong></p>
  
  <pre><code>04-01 12:32:18.964: E/AndroidRuntime(5325): java.lang.UnsatisfiedLinkError: Native method not found: com.example.pjtest.JniClass.get_time:()C
  04-01 12:32:18.964: E/AndroidRuntime(5325):     at com.example.pjtest.JniClass.get_time(Native Method)
  04-01 12:32:18.964: E/AndroidRuntime(5325):     at com.example.pjtest.MainActivity.onCreate(MainActivity.java:18)
  04-01 12:32:18.964: E/AndroidRuntime(5325):     at android.app.Activity.performCreate(Activity.java:5066)
  04-01 12:32:18.964: E/AndroidRuntime(5325):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
  </code></pre>