title: Android Studio build Cocoonjs by Gradle not ANT
body: <p>My project is dependency on Module A &amp; B</p>
  
  <p>And Module A is dependent on Module B</p>
  
  <p>After I setup the dependencies,  Multiple dex exception is encountered.</p>
  
  <blockquote>
    <p>FYI</p>
    
    <p>My project is doing native + Cordova WebView</p>
    
    <p>and I try to accelerate by Ludei WebView+  for the low end model</p>
    
    <p><a href="https://github.com/ludei/webview-plus" rel="nofollow">https://github.com/ludei/webview-plus</a></p>
  </blockquote>
  
  <p>My project dependent on Cordova module &amp; Ludei WebView+ module</p>
  
  <p>Cordova module dependent on Ludei WebView+ module</p>
  
  <p>After these setting I can successfully build by grade with no warning, but I do not pass dexDebug when I want to build application.
  I got this error</p>
  
  <blockquote>
    <p>com.android.dex.DexException: Multiple dex files define Lcom/ludei/chromium/BuildConfig;</p>
  </blockquote>
  
  <p>I know it is officially recommended to build on ANT, I have did some trick I change the webview+ package name I can build the "debug" application but not in "release".</p>
  
  <p>How can I set it properly in android studio to build it by gradle without having multiple dex exception? </p>
  
  <p>---------UPDATE -------------</p>
  
  <p>@Scott Barta Yes, here is whole cordova project under [project]/platforms/android.  </p>
  
  <p>The Whole project files. module: CordovaLib,webviewplus</p>
  
  <blockquote>
    <p><a href="https://github.com/gaplo917/cordova-cocoonjs-gradle" rel="nofollow">https://github.com/gaplo917/cordova-cocoonjs-gradle</a></p>
  </blockquote>
  
  <p>I can build a debug with cocoonjs by changing the package name to another name,i.e. package="com.ludei.android.chromium" but with no luck on building a release version.</p>
  
  <blockquote>
    <p><a href="https://github.com/gaplo917/cordova-cocoonjs-gradle/blob/master/webviewplus/src/main/AndroidManifest.xml" rel="nofollow">https://github.com/gaplo917/cordova-cocoonjs-gradle/blob/master/webviewplus/src/main/AndroidManifest.xml</a></p>
  </blockquote>
  
  <ul>
  <li>if cocoonjs is not run properly, the application can still be built but when you request a cordova web view , it will crash!</li>
  </ul>