title: Gradle dependency for specific architecture with ABI splits
body: <p>Im facing this problem which seems im not able to solve. Here is scenario:</p>
  
  <p>Im building apk which uses gradle dependency and <strong>this dependency is architecture specific</strong> so for apk for x86 i need different dependency and for arm different as well.</p>
  
  <p>I solved it with product flavors:</p>
  
  <pre><code>productFlavors {
  
     dev { ... }
     develx86 { ... }
     production { ... }
     productionx86 { ... }
  
  }
  </code></pre>
  
  <p>So then i defined dependency like this:</p>
  
  <pre><code>develCompile 'dependency_for_arm'
  develx86Compile 'dependency_for_x86'
  </code></pre>
  
  <p>This works good. But recently i had to add to my application an usage of renderscript. I did it in this way:</p>
  
  <pre><code>renderscriptTargetApi 22
  renderscriptSupportModeEnabled true
  </code></pre>
  
  <p>And after this when i uploaded apk on Google Play it says it's apk is suitable with arm, x86. I don't know how this is possible. As you can think it will crash on device with different CPU (if i generated apk for arm and user will execute it on x86 app will crash).</p>
  
  <p>So i decited to use ABI splits:</p>
  
  <pre><code>splits {
          abi {
              enable true
              reset()
              include 'armeabi', 'x86'
              universalApk false
          }
      }
  
  //Ensures architecture specific APKs have a higher version code
  //(otherwise an x86 build would end up using the arm build, which x86 devices can run)
  ext.versionCodes = [armeabi:0, x86:1]
  
  import com.android.build.OutputFile
  
  android.applicationVariants.all { variant -&gt;
      // assign different version code for each output
      variant.outputs.each { output -&gt;
          int abiVersionCode = project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) ?: 0
          output.versionCodeOverride = android.defaultConfig.versionCode + abiVersionCode
      }
  </code></pre>
  
  <p>But now when i see generated apk files, my dependency which is <strong>flavor-specific</strong> is not included into apk and apk will crash when i open section which uses API from this dependency.</p>
  
  <p>Do someone know how to solve this issue? Or someone know why Google Play says that apk is for both architectures when i included renderscript? (Without it it works properly but i need renderscript).</p>
  
  <p>Thank you for your time. I will appreciate any help.</p>