title: Failed to link libstlport_shared, even though it's present...?
body: <p>I'm just about ready to start banging my head off the wall here. I've read every SO thread I can find about this issue, read every single google result on the issue and can't find squat. I'm building an android app where I've written a 2D engine in C++ and I'm using the shared version of stlport with NDK r6b. The .so file for libstlport_shared is generated and copied successfully to my libs folder. I even checked using adb shell on the device and the .so file is copied correctly.</p>
  
  <p>I tried various solutions, such as modifying my .mk file to explicitly declare libstlport_shared.so as a required module. During compile time everything goes great, it shows up in the APK, it successfully copies to the device. Yet I get this error:</p>
  
  <pre><code>09-17 17:35:26.450: DEBUG/dalvikvm(19277): Trying to load lib /data/data/ca.ascensionsystems.mypackagename/lib/libstlport_shared.so 0x476c6f30
  09-17 17:35:26.450: INFO/dalvikvm(19277): Unable to dlopen(/data/data/ca.ascensionsystems.mypackagename/lib/libstlport_shared.so): Cannot load library: link_image[1995]: failed to link libstlport_shared.so
  09-17 17:35:26.450: WARN/dalvikvm(19277): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lca/ascensionsystems/mypackagename/Ascengine;.&lt;clinit&gt;
  09-17 17:35:26.450: WARN/dalvikvm(19277): threadid=8: thread exiting with uncaught exception (group=0x40025a70)
  09-17 17:35:26.470: VERBOSE/WindowManager(4837): Remove Window{479ca678 Starting ca.ascensionsystems.mypackagename paused=false}: mSurface=Surface(name=Starting ca.ascensionsystems.mypackagename, identity=90) mExiting=false isAnimating=true app-animation=android.view.animation.AnimationSet@4794fa10 inPendingTransaction=false mDisplayFrozen=false
  09-17 17:35:26.470: ERROR/WindowManager(4837): return in removeWindowLocked
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277): FATAL EXCEPTION: GLThread 9
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277): java.lang.ExceptionInInitializerError
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     at ca.ascensionsystems.mypackagename.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:336)
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327)
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277): Caused by: java.lang.UnsatisfiedLinkError: Library stlport_shared not found
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     at java.lang.Runtime.loadLibrary(Runtime.java:461)
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     at java.lang.System.loadLibrary(System.java:557)
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     at ca.ascensionsystems.mypackagename.Ascengine.&lt;clinit&gt;(Ascengine.java:26)
  09-17 17:35:26.490: ERROR/AndroidRuntime(19277):     ... 3 more
  09-17 17:35:26.500: WARN/ActivityManager(4837):   Force finishing activity ca.ascensionsystems.mypackagename/.mypackagenameActivity
  </code></pre>
  
  <p>Note that I replaced my real package name with "mypackagename" as to not give away the super secret awesome name of my upcoming game. :) Also note Ascengine is another .SO, my main application SO which is my 2D engine.</p>
  
  <p>Anyone experience an issue like this? Any ideas? Also note I did a objdump on libstlport_shared to check its deps. I confirmed they exist on my device with DDMS and even explicitly loaded them in my java code before attempting to load libstlport_shared. Made no difference. Thanks in advance!</p>
  
  <p><strong>ALSO</strong></p>
  
  <p>This is kind of a second, optional component to the question. One solution I've thought of but haven't tried yet is to use System.load(absolutePathToLibrary) but I can't find how to generate this path within java. I don't want to hard code it, for obvious reasons. Thanks again!</p>