title: Is Renderscript incompatible with NDK libraries in the same project?
body: <p>I have a problem creating an Android app that makes use of both Renderscript and native code generated with NDK.</p>
  
  <p>Substantially, I use NDK tools to generate a library called <code>sprstr_native.so</code>. I managed to call their C++ functions through Java code without problems. Then I needed some Renderscript functionalities (in particular, <code>ScriptIntrinsicYuvToRGB</code>) so I've added to my Eclipse project a reference to the relative support library, <code>renderscript-v8.jar</code>, and this line in the project properties file:</p>
  
  <pre><code>renderscript.support.mode=true
  </code></pre>
  
  <p>Now the problem: Android can't recognize my <code>sprstr_native</code> anymore and the app crashes when calling the code:</p>
  
  <pre><code>System.loadLibrary("sprstr_native");
  </code></pre>
  
  <p>This is the stack:</p>
  
  <pre><code>11-23 17:46:54.450: E/AndroidRuntime(3901): FATAL EXCEPTION: main
  11-23 17:46:54.450: E/AndroidRuntime(3901): java.lang.ExceptionInInitializerError
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at java.lang.Class.newInstanceImpl(Native Method)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at java.lang.Class.newInstance(Class.java:1409)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.os.Handler.dispatchMessage(Handler.java:99)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.os.Looper.loop(Looper.java:130)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at java.lang.reflect.Method.invoke(Method.java:507)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at dalvik.system.NativeStart.main(Native Method)
  11-23 17:46:54.450: E/AndroidRuntime(3901): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load sprstr_native: findLibrary returned null
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at java.lang.System.loadLibrary(System.java:554)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     at com.lag.proj.MainActivity.&lt;clinit&gt;(MainActivity.java:18)
  11-23 17:46:54.450: E/AndroidRuntime(3901):     ... 15 more
  </code></pre>
  
  <p>Curiously, <strong>if I delete all the references to Renderscript the native lib turns to work again</strong>!
  Please don't tell me that there are incompatibilities between Renderscript and NDK code!</p>