Build fails on :app:transformClassesWithDexForProdDebug with Urban Airship SDK 7.0.3, android build tools 23.0.0 (or greater) and multiDex enabled

Using Urban Airship SDK 7.0.3 with android build tools 23.0.0 or greater on an app that requires multiDex to be enabled, building the app fails or hangs (if given more heap) on the gradle task :app:transformClassesWithDexForProdDebug. Only downgrading to build tools 22.0.1 or Urban Airship SDK 6.4.3 resolves this issue.


See error below.


Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
Please assign more memory to Gradle in the project's file.
For example, the following line, in the file, sets the maximum Java heap size to 1,024 MB:
<a href="">Read Gradle's configuration guide</a><br><a href="">Read about Java's heap size</a>
Error:2 errors; aborting
Error:Execution failed for task ':app:transformClassesWithDexForProdDebug'.
> java.lang.RuntimeException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

Didn't find what you were looking for?

New post


1 comment

  • Hi Jonathan,

    Try using build tools 23.0.2 and please make sure that the Android gradle plugin is version 1.5.0.

    I know you noted that increasing the heap causes the app to hang, but try doubling it, and see if that helps. 

    android {  
      dexOptions {  
          javaMaxHeapSize "2048M"  

    Thank you,
    Sean Conlin
    Urban Airship Technical Support
    Portland, Oregon

    Comment actions Permalink

Please sign in to leave a comment.