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 gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
<em>org.gradle.jvmargs=-Xmx1024m</em>
<a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Read Gradle's configuration guide</a><br><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/vm/gc-ergonomics.html">Read about Java's heap size</a>
Error:2 errors; aborting
Error:Execution failed for task ':app:transformClassesWithDexForProdDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: 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

Comments

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

    0

Please sign in to leave a comment.