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

341
Vistas
IDEA can't download sources for my library

I have a library (my own) in a private maven repo. I ship it there with javadoc and sources:

Repo

In my app I've declared this repo:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)

    repositories {
        google()
        mavenCentral()

        maven {
            url = uri("https://jitpack.io")
        }
        maven { // <- This is my private repo
            credentials {
                username = extra["mavenUser"] as String
                password = extra["mavenPassword"] as String
            }
            url = uri(extra["mavenUrl"] as String)
        }
    }
}

It downloads the aar without any problems, but doesn't download sources, and when I'm trying to force it by clicking «Download sources» it fails:

Execution failed for task ':app:DownloadSources'.
> Could not resolve all files for configuration ':app:downloadSources_36c7b334-04c2-4099-b66c-2adc137cc95c'.
   > Could not find com.example.path:common-core:0.0.1@aar.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom
       - https://repo.maven.apache.org/maven2/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom
       - https://jitpack.io/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom
       - https://repo.replaced-domain.com/mvn/replaced/replaced/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom <-- This is my private repo
     Required by:
         project :app

UPD 1: If I click «Choose sources» and specify my local sources jar, it just does nothing.

How to fix it?

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

0

I am not developing with Android Studio currently, but when looking at your output:

Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom
       - https://repo.maven.apache.org/maven2/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom
       - https://jitpack.io/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom
       - https://repo.replaced-domain.com/mvn/replaced/replaced/com/example/path/common-core/0.0.1@aar/common-core-0.0.1@aar.pom <-- This is my private repo

it seems that the ext (extension) part is not correct resolved/calculated.

Maybe it's enough when you explicit set ext inside your dependencies :

build.gradle.kts -> dependencies -> {
    api(group="com.example.path", name="common-core", version="0.0.1", ext="aar")
}
over 4 years ago · Santiago Trujillo Denunciar

0

I have my own library as well, and I suggest to add a classifier in your artifact that specifically downloads sources and Javadoc. Although it is possibly not necessary, it might help in your case - the two last artifacts specifically bring sources and Javadoc:

<dependency>
     <groupId>com.github.michaelgantman</groupId>
     <artifactId>MgntUtils</artifactId>
     <version>1.6.0.1</version>
</dependency>

 <dependency>
     <groupId>com.github.michaelgantman</groupId>
     <artifactId>MgntUtils</artifactId>
     <version>1.6.0.1</version>
     <classifier>javadoc</classifier>
</dependency>

<dependency>
     <groupId>com.github.michaelgantman</groupId>
     <artifactId>MgntUtils</artifactId>
     <version>1.6.0.1</version>
     <classifier>sources</classifier>
</dependency> 
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