Questions tagged [gradle-dependencies]

to manage the versions of all compile and runtime dependencies of a project, including resolution rules for transitive dependencies with conflicting versions.

206 questions
985
votes
26 answers

How can I force Gradle to redownload dependencies?

How can I tell Gradle to redownload dependencies from repositories?
fedor.belov
  • 22,343
  • 26
  • 89
  • 134
155
votes
8 answers

How do I exclude all instances of a transitive dependency when using Gradle?

My gradle project uses the application plugin to build a jar file. As part of the runtime transitive dependencies, I end up pulling in org.slf4j:slf4j-log4j12. (It's referenced as a sub-transitive dependency in at least 5 or 6 other transitive…
Jens D
  • 4,229
  • 3
  • 16
  • 19
126
votes
10 answers

In Gradle, how do I declare common dependencies in a single place?

In Maven there is a very useful feature where you can define a dependency in the section of the parent POM, and reference that dependency from child modules without specifying the version or scope or whatever. What are the…
110
votes
11 answers

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

I use the following two dependencies: compile 'com.google.guava:guava:14.0.1' compile 'com.google.guava:guava-gwt:14.0.1' Both must be the same version to work correctly. Since my other dependencies use a higher version, Gradle uses different…
Michael
  • 32,527
  • 49
  • 210
  • 370
47
votes
3 answers

Android gradle Failed to resolve: play-services-basement

suddenly gradle is unable to build the same code that was working moments ago ! my project depends on google play service dependencies it says : Could not find play-services-basement.aar…
Ahmed Ali
  • 785
  • 1
  • 8
  • 15
24
votes
2 answers

Gradle multi project transitive dependency

I have three gradle projects. Say ProjectA, ProjectB and ProjectC. ProjectC is dependent on both ProjectA and ProjectB. While ProjectB is dependent on ProjectA. So ProjectC's build.gradle has the following lines: dependencies { implementation…
Vicky
  • 16,679
  • 54
  • 139
  • 232
22
votes
1 answer

Android: force gradle to include only one version of a library

I use 'com.android.support:support-v4:23.3.0' in my build.gradle but when explore external libraries I see two version of support-v4 library (23.3.0 & 24.0.0). How can I find which dependency use support-v4:24.0.0 library? How can I force gradle to…
Mneckoee
  • 2,802
  • 6
  • 23
  • 34
14
votes
2 answers

How to ignore bad pom 'inconsistent module descriptor' (version)

I need a dependency which has an inconsistent version number in it's pom. Apache XmlSchema-Pom has as version SNAPSHOT which is obviously not correct as it should be 1.1. According to this gradle discussion it should be possible if the maven…
jmattheis
  • 10,494
  • 11
  • 46
  • 58
13
votes
5 answers

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. while adding new dependencies in android studio chipmunk

These are my gradel files:- Project:- // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id 'com.android.application' version '7.2.1' apply false id 'com.android.library' version…
12
votes
3 answers

Use Gradle sub-projects with Kotlin multiplatform

I'm using Kotlin multi-platform (JVM & JS), which in IDEA creates three projects: demo, demo-js and demo-jvm. I would like to split the common code into more subprojects/submodules. Let's say I add commonmod; how do I make it compile? The error…
Mark
  • 18,730
  • 7
  • 107
  • 130
12
votes
1 answer

Gradle: download Dependencies of included aar-library

I wrote a library-project cameraBarcodeScanner that is built into an aar file. This library has the following dependencies defined in its build.gradle: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile…
8
votes
2 answers

Which Maven BOM determines a dependency's version in Gradle 5?

I am currently developing a Gradle 5 project that imports two different Maven BOMs. Therefore, I use the native Gradle syntax without the dependency management plugin. However, both BOMs may define different versions for the same…
7
votes
2 answers

How to use Gradle "platforms" to align dependency versions in a multi-project setup?

I am trying to learn how to use “platforms” to align dependency versions between projects in a multi-project setup. So far I’ve…
7
votes
4 answers

CrashlyticsInitProvider skipping initialization

I am currently migrating an app from Fabric to Firebase Crashlytics and after updating all the different libraries as stated in the official documentation, I am getting a log message stating that the Crashlytic initialization has been skipped:…
7
votes
3 answers

Failed to resolve: support-compat ONLY FOR :27.1.1

I have an android module with this build.gradle file: apply plugin: 'com.android.library' android { compileSdkVersion 27 defaultConfig { minSdkVersion 14 targetSdkVersion 27 …
1
2 3
13 14