ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.85k stars 199 forks source link

Failed to determine the latest version for the following dependencies #875

Closed johnjohndoe closed 1 month ago

johnjohndoe commented 1 month ago

Project setup

Project link

Report

------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------

The following dependencies are using the latest milestone version:
 - androidx.annotation:annotation:1.8.1
 - androidx.appcompat:appcompat:1.7.0
 - androidx.arch.core:core-testing:2.2.0
 - androidx.compose:compose-bom:2024.06.00
 - androidx.compose.material3:material3:1.2.1
 - androidx.compose.ui:ui-tooling:1.6.8
 - androidx.compose.ui:ui-tooling-preview:1.6.8
 - androidx.core:core-ktx:1.13.1
 - androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4
 - androidx.preference:preference-ktx:1.2.1
 - app.cash.turbine:turbine:1.1.0
 - com.android.tools.build:gradle:8.5.1
 - com.android.tools.utp:android-device-provider-ddmlib:31.5.1
 - com.android.tools.utp:android-device-provider-gradle:31.5.1
 - com.android.tools.utp:android-test-plugin-host-additional-test-output:31.5.1
 - com.android.tools.utp:android-test-plugin-host-apk-installer:31.5.1
 - com.android.tools.utp:android-test-plugin-host-coverage:31.5.1
 - com.android.tools.utp:android-test-plugin-host-device-info:31.5.1
 - com.android.tools.utp:android-test-plugin-host-emulator-control:31.5.1
 - com.android.tools.utp:android-test-plugin-host-logcat:31.5.1
 - com.android.tools.utp:android-test-plugin-host-retention:31.5.1
 - com.android.tools.utp:android-test-plugin-result-listener-gradle:31.5.1
 - com.getkeepsafe.dexcount:dexcount-gradle-plugin:4.0.0
 - com.github.ben-manes:gradle-versions-plugin:0.51.0
 - com.github.bjoernq:unmockplugin:0.8.0
 - com.github.ligi.snackengage:snackengage-playrate:0.30
 - com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.0.0-1.0.23
 - com.google.devtools.ksp:symbol-processing:2.0.0-1.0.23
 - com.google.devtools.ksp:symbol-processing-api:2.0.0-1.0.23
 - com.google.devtools.ksp:symbol-processing-cmdline:2.0.0-1.0.23
 - com.google.truth:truth:1.4.4
 - com.squareup.moshi:moshi-kotlin-codegen:1.15.1
 - com.squareup.okhttp3:logging-interceptor:4.12.0
 - com.squareup.okhttp3:mockwebserver:4.12.0
 - com.squareup.okhttp3:okhttp:4.12.0
 - com.squareup.retrofit2:converter-moshi:2.11.0
 - de.cketti.mailto:email-intent-builder:2.0.0
 - de.mannodermaus.junit5:android-test-core:1.5.0
 - de.mannodermaus.junit5:android-test-runner:1.5.0
 - io.noties.markwon:core:4.6.2
 - io.noties.markwon:linkify:4.6.2
 - me.saket:better-link-movement-method:2.2.0
 - org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.0.0
 - org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.0
 - org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.0
 - org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable:2.0.0
 - org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0
 - org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.0
 - org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.0
 - org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.0
 - org.jetbrains.kotlin:kotlin-stdlib:2.0.0
 - org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1
 - org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1
 - org.junit.jupiter:junit-jupiter-api:5.10.3
 - org.junit.jupiter:junit-jupiter-engine:5.10.3
 - org.junit.jupiter:junit-jupiter-params:5.10.3
 - org.mockito:mockito-core:5.12.0
 - org.mockito.kotlin:mockito-kotlin:5.4.0
 - org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:5.1.0.4882
 - org.threeten:threetenbp:1.6.9

The following dependencies have later milestone versions:
 - com.github.ligi:tracedroid [3.1 -> 4.1]

Failed to determine the latest version for the following dependencies (use --info for details):
 - androidx.constraintlayout:constraintlayout
     2.1.4
 - androidx.lifecycle:lifecycle-runtime-ktx
     2.8.4
 - com.google.android.material:material
     1.12.0
 - com.google.testing.platform:android-driver-instrumentation
 - com.google.testing.platform:android-test-plugin
 - com.google.testing.platform:core
 - com.google.testing.platform:launcher
 - com.squareup.moshi:moshi
     1.15.1
 - com.squareup.retrofit2:retrofit
     2.11.0
 - info.metadude.kotlin.library.engelsystem:engelsystem-base
     9.1.0
 - org.jetbrains.kotlinx:kotlinx-coroutines-android
     1.8.1
 - org.robolectric:android-all

Gradle current updates:
 - Gradle: [8.9: UP-TO-DATE]

Related

ben-manes commented 1 month ago

Thanks for your answer. After looking at this issue, I've updated to Kotlin 2.0.20-Beta1 and I no longer have the issue ✅.

https://github.com/ben-manes/gradle-versions-plugin/issues/874#issuecomment-2247068237

johnjohndoe commented 1 month ago

With 2.0.20-Beta1 the lower end of the report looks like this:

...

The following dependencies exceed the version found at the milestone revision level:
 - org.jetbrains.kotlin:compose-compiler-gradle-plugin [2.0.20-Beta1 <- 2.0.0]
     https://kotlinlang.org/
 - org.jetbrains.kotlin:kotlin-gradle-plugin [2.0.20-Beta1 <- 2.0.0]
     https://kotlinlang.org/
 - org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable [2.0.20-Beta1 <- 2.0.0]
     https://kotlinlang.org/

The following dependencies have later milestone versions:
 - com.github.ligi:tracedroid [3.1 -> 4.1]

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.google.testing.platform:android-driver-instrumentation
 - com.google.testing.platform:android-test-plugin
 - com.google.testing.platform:core
 - com.google.testing.platform:launcher
 - org.jetbrains.kotlin:kotlin-build-tools-impl
 - org.jetbrains.kotlin:kotlin-stdlib
     2.0.0
 - org.robolectric:android-all

Gradle current updates:
 - Gradle: [8.9: UP-TO-DATE]

It looks like the lookup still does not work.

jaredsburrows commented 1 month ago

2.0.20-Beta1 is newer than 2.0.0. Technically this is correct, but it should be 2.0.0 -> 2.0.20-Beta1.

ben-manes commented 1 month ago

Maven's version plugin displays as (current version)...(suggested version), but doesn't report all scenarios, which seemed useful to do merely for debugging purposes. The formatting is a little weird but keeps it consistent to be less confusing, and the section is mostly a warning of a possible configuration issue that the report would suggest a downgrade based on what its update queries found.

johnjohndoe commented 1 month ago

I am not concerned about the kotlin lines. I like to point out the unresolved dependencies in the Failed to determine the latest version for the following dependencies block.

ben-manes commented 1 month ago

you'd have to use --info to see what the error was

ben-manes commented 1 month ago

When I run the task on your project, I see it spends a long time on rejections,

Selection of com.android.tools.utp:android-test-plugin-host-apk-installer:31.6.0-alpha06 rejected by component selection rule: Rejected by rejectVersionIf

If I remove that logic and use the beta plugin then it all resolves correctly

```console > Task :dependencyUpdates ------------------------------------------------------------ : Project Dependency Updates (report to plain text file) ------------------------------------------------------------ The following dependencies are using the latest milestone version: - androidx.appcompat:appcompat:1.7.0 - androidx.arch.core:core-testing:2.2.0 - androidx.compose:compose-bom:2024.06.00 - androidx.preference:preference-ktx:1.2.1 - app.cash.turbine:turbine:1.1.0 - com.getkeepsafe.dexcount:dexcount-gradle-plugin:4.0.0 - com.github.ben-manes:gradle-versions-plugin:0.51.0 - com.github.ligi.snackengage:snackengage-playrate:0.30 - com.google.testing.platform:android-driver-instrumentation:0.0.9-alpha02 - com.google.testing.platform:android-test-plugin:0.0.9-alpha02 - com.google.testing.platform:core:0.0.9-alpha02 - com.google.testing.platform:launcher:0.0.9-alpha02 - com.google.truth:truth:1.4.4 - com.squareup.moshi:moshi:1.15.1 - com.squareup.moshi:moshi-kotlin-codegen:1.15.1 - com.squareup.retrofit2:converter-moshi:2.11.0 - com.squareup.retrofit2:retrofit:2.11.0 - de.cketti.mailto:email-intent-builder:2.0.0 - info.metadude.kotlin.library.engelsystem:engelsystem-base:9.1.0 - io.noties.markwon:core:4.6.2 - io.noties.markwon:linkify:4.6.2 - me.saket:better-link-movement-method:2.2.0 - org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.20-Beta1 - org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.20-Beta1 - org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.20-Beta1 - org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.20-Beta1 - org.mockito:mockito-core:5.12.0 - org.mockito.kotlin:mockito-kotlin:5.4.0 - org.threeten:threetenbp:1.6.9 The following dependencies have later milestone versions: - androidx.annotation:annotation [1.8.0 -> 1.9.0-alpha01] https://developer.android.com/jetpack/androidx/releases/annotation#1.9.0-alpha01 - androidx.compose.material3:material3 [1.2.1 -> 1.3.0-beta05] https://developer.android.com/jetpack/androidx/releases/compose-material3#1.3.0-beta05 - androidx.compose.ui:ui-tooling [1.6.8 -> 1.7.0-beta06] https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0-beta06 - androidx.compose.ui:ui-tooling-preview [1.6.8 -> 1.7.0-beta06] https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0-beta06 - androidx.constraintlayout:constraintlayout [2.1.4 -> 2.2.0-alpha13] https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.0-alpha13 - androidx.core:core-ktx [1.13.1 -> 1.15.0-alpha01] https://developer.android.com/jetpack/androidx/releases/core#1.15.0-alpha01 - androidx.lifecycle:lifecycle-runtime-ktx [2.8.3 -> 2.8.4] https://developer.android.com/jetpack/androidx/releases/lifecycle#2.8.4 - androidx.lifecycle:lifecycle-viewmodel-ktx [2.8.3 -> 2.8.4] https://developer.android.com/jetpack/androidx/releases/lifecycle#2.8.4 - com.android.tools.build:gradle [8.5.1 -> 8.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-device-provider-ddmlib [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-device-provider-gradle [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-additional-test-output [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-apk-installer [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-coverage [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-device-info [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-emulator-control [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-logcat [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-host-retention [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.android.tools.utp:android-test-plugin-result-listener-gradle [31.5.1 -> 31.7.0-alpha03] https://developer.android.com/studio/build - com.github.bjoernq:unmockplugin [0.7.9 -> 0.8.0] https://github.com/bjoernq/unmock-plugin - com.github.ligi:tracedroid [3.1 -> 4.1] - com.google.android.material:material [1.12.0 -> 1.13.0-alpha04] https://github.com/material-components/material-components-android - com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin [2.0.0-1.0.23 -> 2.0.20-RC-1.0.24] https://goo.gle/ksp - com.google.devtools.ksp:symbol-processing [2.0.0-1.0.23 -> 2.0.20-RC-1.0.24] https://goo.gle/ksp - com.google.devtools.ksp:symbol-processing-api [2.0.0-1.0.23 -> 2.0.20-RC-1.0.24] https://goo.gle/ksp - com.google.devtools.ksp:symbol-processing-cmdline [2.0.0-1.0.23 -> 2.0.20-RC-1.0.24] https://goo.gle/ksp - com.squareup.okhttp3:logging-interceptor [4.12.0 -> 5.0.0-alpha.14] https://square.github.io/okhttp/ - com.squareup.okhttp3:mockwebserver [4.12.0 -> 5.0.0-alpha.14] https://square.github.io/okhttp/ - com.squareup.okhttp3:okhttp [4.12.0 -> 5.0.0-alpha.14] https://square.github.io/okhttp/ - de.mannodermaus.junit5:android-test-core [1.4.0 -> 1.5.0] https://github.com/mannodermaus/android-junit5 - de.mannodermaus.junit5:android-test-runner [1.4.0 -> 1.5.0] https://github.com/mannodermaus/android-junit5 - org.jetbrains.kotlin:compose-compiler-gradle-plugin [2.0.20-Beta1 -> 2.0.20-RC] https://kotlinlang.org/ - org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable [2.0.20-Beta1 -> 2.0.20-RC] https://kotlinlang.org/ - org.jetbrains.kotlin:kotlin-gradle-plugin [2.0.20-Beta1 -> 2.0.20-RC] https://kotlinlang.org/ - org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable [2.0.20-Beta1 -> 2.0.20-RC] https://kotlinlang.org/ - org.jetbrains.kotlin:kotlin-stdlib [2.0.20-Beta1 -> 2.0.20-RC] https://kotlinlang.org/ - org.jetbrains.kotlinx:kotlinx-coroutines-android [1.8.1 -> 1.9.0-RC] https://github.com/Kotlin/kotlinx.coroutines - org.jetbrains.kotlinx:kotlinx-coroutines-core [1.8.1 -> 1.9.0-RC] https://github.com/Kotlin/kotlinx.coroutines - org.jetbrains.kotlinx:kotlinx-coroutines-test [1.8.1 -> 1.9.0-RC] https://github.com/Kotlin/kotlinx.coroutines - org.junit.jupiter:junit-jupiter-api [5.10.3 -> 5.11.0-RC1] https://junit.org/junit5/ - org.junit.jupiter:junit-jupiter-engine [5.10.3 -> 5.11.0-RC1] https://junit.org/junit5/ - org.junit.jupiter:junit-jupiter-params [5.10.3 -> 5.11.0-RC1] https://junit.org/junit5/ - org.robolectric:android-all [4.3_r2-robolectric-0 -> 14-robolectric-10818077] http://source.android.com/ - org.sonarsource.scanner.gradle:sonarqube-gradle-plugin [5.0.0.4638 -> 5.1.0.4882] ```
johnjohndoe commented 1 month ago

Oh! How do you remove com.android.tools.utp:android-test-plugin-host-apk-installer?

ben-manes commented 1 month ago

if it doesn't have a stable release then when you're rejecting all non-stable the resolution fails. You could instead use

rejectVersionIf {
  isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
johnjohndoe commented 1 month ago

I see. In combination with 2.0.20-Beta1 the rejectVersionIf helps. Seems this will be a temporary issue which disappears with new version of the dependencies... hopefully. Thank you for the workaround.