title: Build APK - ERROR - app:transformClassesWithDexForDebug
body: <p>I watched so many threads here and still didnt find working solution.</p>
  
  <p><strong>When I want to BUILD APK, I get this main error:</strong></p>
  
  <blockquote>
    <p>Error:Execution failed for task
    ':app:transformClassesWithDexForDebug'.
    com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
    java.util.concurrent.ExecutionException:
    com.android.ide.common.process.ProcessException: Error while executing
    java process with main class com.android.dx.command.Main with
    arguments {--dex --num-threads=4 --multi-dex --main-dex-list
    C:\Users\ratik\Desktop\BUILDBOX\VOLUNTEER\STUDIO\app\build\intermediates\multi-dex\debug\maindexlist.txt
    --output C:\Users\ratik\Desktop\BUILDBOX\VOLUNTEER\STUDIO\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main
    C:\Users\ratik\Desktop\BUILDBOX\VOLUNTEER\STUDIO\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}</p>
  </blockquote>
  
  <p>There is few more errors, but then apear only sometimes, some of them:</p>
  
  <blockquote>
    <p>Error:    at
    com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)</p>
    
    <p>Error:    at
    com.android.dx.command.dexer.Main.processFileBytes(Main.java:723)</p>
    
    <p>Error:    at
    com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)</p>
    
    <p>Error:java.lang.OutOfMemoryError: GC overhead limit exceeded</p>
  </blockquote>
  
  <p><strong>What I tried:</strong> </p>
  
  <p>In build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 25
      buildToolsVersion "25.0.2"
  
      defaultConfig {
          applicationId "com.biif.volunteer"
          minSdkVersion 14
          targetSdkVersion 25
          multiDexEnabled true
  
          ndk {
              moduleName "player_shared"
          }
  
      }
  
      buildTypes {
          release {
              minifyEnabled false
              shrinkResources false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
  
  
      }
      sourceSets.main {
          jni.srcDirs = []// &lt;-- disable automatic ndk-build call
      }
  }
  
  dependencies {
      compile ('com.google.android.gms:play-services:+'){exclude module: 'support-v4'}
      compile files('libs/dagger-1.2.2.jar')
      compile files('libs/javax.inject-1.jar')
      compile files('libs/nineoldandroids-2.4.0.jar')
      compile files('libs/support-v4-19.0.1.jar')
      compile ('com.android.support:multidex:1.0.1')
  }
  </code></pre>
  
  <p>In Manifest</p>
  
  <blockquote>
    <p>android:name="android.support.multidex.MultiDexApplication"</p>
  </blockquote>
  
  <p>Plus I turned off Instant run (saw in one thread here).</p>
  
  <p><strong>Nothing helped :( Any ideas please? Thanks for help guys :)</strong></p>