Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

363
Vistas
Gradle composite build cannot find included project dependency

I'm trying to set up a composite build. The current structure is

projectA
  -build.gradle
  -settings.gradle
  -app
    -build.gradle
projectB
  -buid.gradle
  -settings.gradle
  -sdk
    -build.gradle

I need to use projectB as a dependency in projectA, however, projectB still needs to function as a standalone project.

Here's what I have currently

ProjectA settings.gradle contains

includeBuild('../projectB')

ProjectA build.gradle contains

group "com.example"

projectA:App build.gradle contains

dependencies {
  implementation 'com.example:projectB'
}

projectB build.gradle contains

group "com.example"

However, when I try to build projectA, I get the error:

Could not resolve com.example:projectB.
 Required by:
     project :app

What am I doing wrong here? I feel like it has something to do with the 'com.example', but I can't figure out what the correct way to reference the included project as a dependency is.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You are not substituting the dependency in project A. You can refer to example 6 in this section: https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions

In your case, you want to modify the settings.gradle file of project A to look something like:

includeBuild('../projectB') {
    dependencySubstitution {
          substitute module("com.example:projectB") using project(':projectB')
    }
}

This will tell gradle that during the configuration phase, it should replace any dependency on com.example:projectB with project :projectB found in ../projectB.

Having said the above, it looks like you are actually interested in including the sdk module defined in projectB. If this is the case, you can replace using project(':projectB') with using project(':sdk')

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda