title: Android NDK prebuild shared library usage
body: <p>I have precompiled shared library (.so), named libxxx.so.3.3. I don't know why the name after compilation was "libxxx.so.3.3". I'd like to use it in my Android app via JNI. For this i've created ndk module xxx_jni:</p>
  
  <p>Android.mk:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE := xxx
  LOCAL_SRC_FILES := xxx.so
  include $(PREBUILT_SHARED_LIBRARY)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE    := xxx_jni
  LOCAL_SRC_FILES := xxx_wrapper.c
  LOCAL_SHARED_LIBRARIES := xxx
  LOCAL_C_INCLUDES := /softdev/xxx/host/include/
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>I had to rename "<em>.so.3.3" to "</em>.so" as ndk-build failed to compile libxxx_jni.so:</p>
  
  <pre><code>Android NDK: ERROR:/Users/user/Documents/dev/src/xxx_jni/jni/Android.xxx: LOCAL_SRC_FILES should point to a file ending with ".so"    
  Android NDK: The following file is unsupported: libxxx.so.3.3    
  </code></pre>
  
  <p>My wrapper class (for JNI):</p>
  
  <pre><code>#include "xxx_wrapper.h"
  #include &lt;xxx-c/Index.h&gt; // include "xxx" library header
  
  #ifndef _Included_name_antonsmirnov_android_xxx_wrapper
  #define _Included_name_antonsmirnov_android_xxx_wrapper
  #ifdef __cplusplus
  extern "C" {
  #endif
  /*
   * Class:     name_antonsmirnov_android_xxx_wrapper
   * Method:    exec_test
   * Signature: (Ljava/lang/String;)I
   */
  JNIEXPORT jint JNICALL Java_name_antonsmirnov_android_xxx_1wrapper_exec_1test(JNIEnv *, jobject, jstring)
  {
      // using method from "xxx" library
      xxx_method();
  
      return 7;
  }
  </code></pre>
  
  <p>So after ndk compilation (ndk-build) i have 2 stripped files in "libs/armeabi" folder: libxxx.so and libxxx_jni.so.</p>
  
  <p>Then i try to load libraries in runtime in wrapper class:</p>
  
  <pre><code>public class xxx_wrapper {
  
      static {
          System.loadLibrary("xxx");
          System.loadLibrary("xxx_jni"); // error here!
      }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>at dalvik.system.NativeStart.main(Native Method)
          Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]:   167 could not load needed library 'libxxx.so.3.3' for 'libxxx_jni.so' (load_library[1093]: Library 'libxxx.so.3.3' not found)
  </code></pre>
  
  <p>So i'm in stuck what i've missed.. I've tried to leave ".so.3.3" extension and symlink ".so" -> ".so.3.3" but the same result. As far as i understand the problem is that xxx_wrapper lib still wants ".so.3.3" library loaded, but it's ".so".</p>