How can I force Gradle to set the same version for two dependencies?

Add this section to just above your dependencies block.

Groovy/Gradle:

configurations.all {
  resolutionStrategy { 
    force 'com.google.guava:guava:14.0.1'
    force 'com.google.guava:guava-gwt:14.0.1'
  }
}

Kotlin Script:

configurations.all {
  resolutionStrategy {
    force("com.google.guava:guava:14.0.1")
    force("com.google.guava:guava-gwt:14.0.1")
  }
}

Leave a Comment