Friday, May 5, 2017

Gradle Failed for Google Guava: transformClassesWithDexForDebug TransformException

Meet the compile issue when adding Google Guava into my Android project:

dependencies {
  compile 'com.google.guava:guava:21.0'
}
Error:

10:16:43.803 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > com.android.build.api.transform.TransformException: com.android.ide.common.pro
cess.ProcessException: Error while executing java process with main class com.android.multidex.ClassReferenceListBuilder with arguments {xxxxxxxxxxx\build\intermediates\multi-dex\debug\componentClasses.jar xxxxxxxxx\build\intermediates\transforms\jarMerging\de
bug\jars\1\1f\combined.jar}

After downgrade guava to version 19 the project passed build successfully:
dependencies {
  compile 'com.google.guava:guava:19.0'
}
Have no time to dig into the root cause yet, record here for reference.

1 comment:

  1. You've just saved my day ! Thanks a lot from France !

    ReplyDelete

Thrift fails on Windows - thrift failed error: The command line is too long.

Meet a thrift compiling failure on my project on Windows 7. Using Maven in IntelliJ so I choiced maven-thrift-pluging for thrift files. For ...