title: How-to use a shared library in native-activity
body: <p>I have an Android project with a native activity.
  This native activity uses a shared library named "main" (libmain.so file) for starting.
  ( with the code of ndk/samples/native-activity )</p>
  
  <p>This app works fine.</p>
  
  <p>the "main" module Android.mk file :</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := main
  LOCAL_SRC_FILES := main.cpp
  
  LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
  
  LOCAL_STATIC_LIBRARIES := android_native_app_glue game
  
  include $(BUILD_SHARED_LIBRARY)
  
  $(call import-module,android/native_app_glue)
  </code></pre>
  
  <p>Now I want to add another shared library (for example a game engine) used by "main" library.
  I have built a "game" module (libgame.so).</p>
  
  <p>But when I link the "main" with the "game", like this :</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := main
  LOCAL_SRC_FILES := main.cpp
  
  LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../game
  
  LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
  LOCAL_LDLIBS += $(LOCAL_PATH)/../../libs/$(TARGET_ARCH_ABI)/libgame.so
  
  LOCAL_STATIC_LIBRARIES := android_native_app_glue game
  
  include $(BUILD_SHARED_LIBRARY)
  
  $(call import-module,android/native_app_glue)
  </code></pre>
  
  <p>with code no changes !<br>
  the app doesn't start anymore and I have this error in Logcat :</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.myproject/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/data/com.mycompany.myproject/lib/libmain.so
  </code></pre>
  
  <p>This crash is due to adding link to a shared library ...</p>
  
  <p>Why linking to a shared library make the app not loading (crash) ?<br>
  How can I use a shared library in a native android project (no-java / native-activity) ?<br>
  (I suppose it can be possible ... otherwise the native activity is quite limited ...)  </p>
  
  <p>Thanks ! :)</p>