title: RenderScript V8 multiple dex files defined
body: <p>I'm trying to get this to work for some time now. <br>
  I am using a module StackBlur <a href="https://github.com/kikoso/android-stackblur" rel="nofollow">https://github.com/kikoso/android-stackblur</a>
  This is how the Graddle file looks like:</p>
  
  <pre><code>apply plugin: 'android-library'
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
  }
  
  android {
      compileSdkVersion 21
      buildToolsVersion '21.1.2'
  
      defaultConfig {
          renderscriptTargetApi 19
          renderscriptSupportModeEnabled true
      }
  
  sourceSets {
      main {
          manifest.srcFile 'AndroidManifest.xml'
          java.srcDirs = ['src']
          resources.srcDirs = ['src']
          aidl.srcDirs = ['src']
          renderscript.srcDirs = ['src']
          res.srcDirs = ['res']
          assets.srcDirs = ['assets']
      }
  
      // Move the tests to tests/java, tests/res, etc...
      instrumentTest.setRoot('tests')
  
      // Move the build types to build-types/&lt;type&gt;
      // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
      // This moves them out of them default location under src/&lt;type&gt;/... which would
      // conflict with src/ being used by the main source set.
      // Adding new build types or product flavors should be accompanied
      // by a similar customization.
      debug.setRoot('build-types/debug')
      release.setRoot('build-types/release')
  }
  }
  
      task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native libs') {
          destinationDir file("$buildDir/native-libs")
          baseName 'native-libs'
          extension 'jar'
          from fileTree(dir: 'libs', include: '**/*.so')
          from fileTree(dir: 'renderscript', include: '**/*.so')
          into 'lib/'
      }
  
      tasks.withType(JavaCompile) {
          compileTask -&gt; compileTask.dependsOn(nativeLibsToJar)
      }
  </code></pre>
  
  <p>Everything from this library works perfectly. However, when I try to use RenderScript in my own project, with my own code. The troubles start. If I don't put RenderScript in my App graddle file I get the error:<br><br>
  <code>Error loading RS jni library: java.lang.UnsatisfiedLinkError: Couldn't load RSSupport from loader dalvik.system.PathClassLoader[]: findLibrary returned null</code><br><br>
  And when I put the renderscript values in my own Graddle file, there starts to be a dex file exception:<br><br>
  UNEXPECTED TOP-LEVEL EXCEPTION:</p>
  
  <pre><code>com.android.dex.DexException: Multiple dex files define Landroid/support/v8/renderscript/Allocation$1;
  </code></pre>
  
  <p>The dexfile exception obviously happens because they both add the RenderScriptSupportEnabled true and RenderScriptTargetApi. But I do not know what I need to do to let them both work. Whenever I delete the renderscript in my own graddle, my project won't work, but when I delete it in the StackBlur module, that one will not work.<br><br>
  Any suggestions?<br>This is my graddle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  android {
      compileSdkVersion 21
      buildToolsVersion "21.1.2"
      defaultConfig {
          applicationId "package.name.app"
          minSdkVersion 17
          targetSdkVersion 21
          versionCode 1
          versionName "1.0"
          renderscriptSupportModeEnabled true
          renderscriptTargetApi 19
  
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:appcompat-v7:21+'
      compile 'com.android.support:support-v4:21.0.2'
      compile 'com.android.support:cardview-v7:21.0.+'
      compile 'com.android.support:recyclerview-v7:21.0.+'
      compile project(':StackBlur')
  }
  </code></pre>