Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve a bunch of dependencies, not sure why #803

Closed
kibotu opened this issue Aug 22, 2023 · 4 comments
Closed

Can't resolve a bunch of dependencies, not sure why #803

kibotu opened this issue Aug 22, 2023 · 4 comments

Comments

@kibotu
Copy link

kibotu commented Aug 22, 2023

the following dependencies can't be resolved:

note:
glide compiler fails, but glide works o.O
https://mvnrepository.com/artifact/com.github.bumptech.glide/compiler
https://mvnrepository.com/artifact/com.github.bumptech.glide/glide

I can't think of a reason why, e.g. okhttp fails, it's also available on mvncentral
https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp

Failed to determine the latest version for the following dependencies (use --info for details):
 - androidx.compose.ui:ui-test-junit4
 - com.airbnb.android:showkase-processor
 - com.github.blocoio:faker
 - com.github.bumptech.glide:compiler
 - com.github.mrmike:ok2curl
 - com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter
 - com.squareup.moshi:moshi
 - com.squareup.moshi:moshi-adapters
 - com.squareup.okhttp3:logging-interceptor
 - com.squareup.okhttp3:okhttp
 - dev.zacsweers.moshix:moshi-ksp
 - io.reactivex.rxjava3:rxjava
 - org.jetbrains.kotlinx:kotlinx-coroutines-android
 - org.jetbrains.kotlinx:kotlinx-coroutines-play-services
 - org.robolectric:robolectric

i'm using the following configuration:

buildscript {

    repositories {
        maven { url "https://maven-central-eu.storage-download.googleapis.com/maven2/" }
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.github.ben-manes:gradle-versions-plugin:0.47.0"
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:5.1.0"
    }
}

allprojects {

    repositories {
        maven { url "https://maven-central-eu.storage-download.googleapis.com/maven2/" }
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url 'https://jitpack.io' }
    }
}


// dependency versions ./gradlew dependencyUpdates
apply plugin: 'com.github.ben-manes.versions'
apply plugin: "com.jfrog.artifactory"
apply plugin: 'maven-publish'


dependencyUpdates.resolutionStrategy {
    componentSelection { rules ->
        rules.all { ComponentSelection selection ->
            boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea', 'dev01'].any { qualifier ->
                selection.candidate.version ==~ /(?i).*[.-]$qualifier[.\d+-]*/
            }
            if (rejected) {
                selection.reject('Release candidate')
            }
        }
    }
}
@ben-manes
Copy link
Owner

Usually that means something else, like a resolution strategy, failed (like an npe) and had a large blast radius. You can look as the info log for the errors to see where the problem might be.

@kibotu
Copy link
Author

kibotu commented Aug 23, 2023

good point!

i've attached the log file of

./gradlew --refresh-dependencies --s dependencyUpdates -DoutputFormatter=plain,xml,html --info > build.txt

build.txt

I can't make sense out of the exceptions exactly though :/

It's trying to find a variant with attribute 'org.gradle.jvm.version' with value '2147483647', but none of the available variants match this. The key is in this line: "The consumer was configured to find attribute 'org.gradle.jvm.version' with value '2147483647'."

We don't use version wildcards though.

@ben-manes
Copy link
Owner

By chance do you have empty sub-projects (#746)?

That is the TARGET_JVM_VERSION_ATTRIBUTE attribute saying it is compatible with any jvm version (Integer.MAX_VALUE). It was added based on the advice from a Gradle engineer in #727.

@kibotu
Copy link
Author

kibotu commented Aug 24, 2023

Bullseye! That was it, thanks a lot, I've moved my script into a separate job where it is the root gradle project + applying the apply plugin: 'jvm-ecosystem' and it works now as expected :)

@kibotu kibotu closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants