ben-manes / gradle-versions-plugin

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

[Bug] Failed to determine the latest version for the following dependencies - implementation(kotlin("stdlib")) #599

Closed jaredsburrows closed 2 years ago

jaredsburrows commented 2 years ago

Repro:

git clone https://github.com/jaredsburrows/android-gif-example cd android-gif-example gradlew dependencyUpdates

dependencies {
  // Kotlin
  implementation(platform(libs.kotlin.bom))
  implementation(kotlin("stdlib"))
  implementation(kotlin("stdlib-common"))
  implementation(kotlin("stdlib-jdk7"))
  implementation(kotlin("stdlib-jdk8"))
}

Failed to determine the latest version for the following dependencies (use --info for details):

 - org.jetbrains.kotlin:kotlin-stdlib
     1.6.21
 - org.jetbrains.kotlin:kotlin-stdlib-common
     1.6.21
 - org.jetbrains.kotlin:kotlin-stdlib-jdk7
     1.6.21
 - org.jetbrains.kotlin:kotlin-stdlib-jdk8
     1.6.21
ben-manes commented 2 years ago

Can you try with Gradle 7.3? It seems that unspecified changes in 7.4+ broke resolution but the Gradle team is not actively working on that regression. See #471.

ben-manes commented 2 years ago

Confirmed, this is Gradle's regression. I don't have enough information to move forward with as to what changed and how to adapt. From what I can tell this is a Gradle problem, but I am open any suggested changes. @ljacomet

Success on gradle 7.3.3 ```sh Starting a Gradle Daemon, 1 busy and 1 stopped Daemons could not be reused, use --status for details Type-safe dependency accessors is an incubating feature. > Task :dependencyUpdates ------------------------------------------------------------ : Project Dependency Updates (report to plain text file) ------------------------------------------------------------ The following dependencies are using the latest milestone version: - androidx.activity:activity:1.4.0 - androidx.activity:activity-ktx:1.4.0 - androidx.annotation:annotation:1.3.0 - androidx.appcompat:appcompat:1.4.1 - androidx.arch.core:core-testing:2.1.0 - androidx.cardview:cardview:1.0.0 - androidx.constraintlayout:constraintlayout:2.1.3 - androidx.core:core:1.7.0 - androidx.core:core-ktx:1.7.0 - androidx.databinding:viewbinding:7.1.3 - androidx.lifecycle:lifecycle-common:2.4.1 - androidx.lifecycle:lifecycle-common-java8:2.4.1 - androidx.lifecycle:lifecycle-compiler:2.4.1 - androidx.lifecycle:lifecycle-extensions:2.2.0 - androidx.lifecycle:lifecycle-livedata:2.4.1 - androidx.lifecycle:lifecycle-livedata-core:2.4.1 - androidx.lifecycle:lifecycle-livedata-ktx:2.4.1 - androidx.lifecycle:lifecycle-viewmodel:2.4.1 - androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1 - androidx.recyclerview:recyclerview:1.2.1 - androidx.startup:startup-runtime:1.1.1 - androidx.swiperefreshlayout:swiperefreshlayout:1.1.0 - androidx.test:annotation:1.0.0 - androidx.test:core:1.4.0 - androidx.test:orchestrator:1.4.1 - androidx.test:rules:1.4.0 - androidx.test:runner:1.4.0 - androidx.test.espresso:espresso-contrib:3.4.0 - androidx.test.espresso:espresso-core:3.4.0 - androidx.test.espresso:espresso-intents:3.4.0 - androidx.test.ext:junit:1.1.3 - androidx.webkit:webkit:1.4.0 - com.android.application:com.android.application.gradle.plugin:7.1.3 - com.android.library:com.android.library.gradle.plugin:7.1.3 - com.android.tools:desugar_jdk_libs:1.1.5 - com.getkeepsafe.dexcount:com.getkeepsafe.dexcount.gradle.plugin:3.1.0 - com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.42.0 - com.github.bumptech.glide:compiler:4.13.1 - com.github.bumptech.glide:glide:4.13.1 - com.github.bumptech.glide:okhttp3-integration:4.13.1 - com.google.android.material:material:1.5.0 - com.google.code.findbugs:jsr305:3.0.2 - com.google.dagger:hilt-android:2.41 - com.google.dagger:hilt-android-compiler:2.41 - com.google.dagger:hilt-android-testing:2.41 - com.google.dagger.hilt.android:com.google.dagger.hilt.android.gradle.plugin:2.41 - com.google.truth:truth:1.1.3 - com.jakewharton.timber:timber:5.0.1 - com.jaredsburrows.license:com.jaredsburrows.license.gradle.plugin:0.9.0 - com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0 - com.squareup.moshi:moshi:1.13.0 - com.squareup.moshi:moshi-adapters:1.13.0 - com.squareup.moshi:moshi-kotlin-codegen:1.13.0 - com.squareup.okhttp3:logging-interceptor:4.9.3 - com.squareup.okhttp3:mockwebserver:4.9.3 - com.squareup.okhttp3:okhttp:4.9.3 - com.squareup.okhttp3:okhttp-bom:4.9.3 - com.squareup.okio:okio:3.1.0 - com.squareup.retrofit2:converter-moshi:2.9.0 - com.squareup.retrofit2:retrofit:2.9.0 - junit:junit:4.13.2 - org.glassfish:javax.annotation:10.0-b28 - org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.6.21 - org.jetbrains.kotlin:kotlin-bom:1.6.21 - org.jetbrains.kotlin:kotlin-stdlib:1.6.21 - org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21 - org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21 - org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 - org.jetbrains.kotlin:kotlin-test:1.6.21 - org.jetbrains.kotlin:kotlin-test-common:1.6.21 - org.jetbrains.kotlin:kotlin-test-junit:1.6.21 - org.jetbrains.kotlin.android:org.jetbrains.kotlin.android.gradle.plugin:1.6.21 - org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.21 - org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 - org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1 - org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 - org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1 - org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.1 - org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1 - org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.6.1 - org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:10.2.1 - org.reflections:reflections:0.10.2 - org.robolectric:annotations:4.7.3 - org.robolectric:robolectric:4.7.3 The following dependencies have later milestone versions: - com.pinterest:ktlint [0.42.1 -> 0.45.2] https://github.com/pinterest/ktlint - com.squareup.leakcanary:leakcanary-android-instrumentation [2.8.1 -> 2.9.1] https://github.com/square/leakcanary/ - com.squareup.leakcanary:leakcanary-android-startup [2.8.1 -> 2.9.1] https://github.com/square/leakcanary/ - javax.annotation:jsr250-api [1.0 -> 1.0-20050927.133100] https://jax-ws.dev.java.net/ - org.jacoco:org.jacoco.ant [0.8.3 -> 0.8.8] http://jacoco.org - org.mockito:mockito-inline [4.5.0 -> 4.5.1] https://github.com/mockito/mockito Gradle release-candidate updates: - Gradle: [7.3.3 -> 7.4.2] Generated report file build/dependencyUpdates/report.txt BUILD SUCCESSFUL in 2m 48s 1 actionable task: 1 executed Publishing build scan... https://gradle.com/s/rr3kta4ivv3hm ````
git diff ```diff diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c5fbaeb..913110f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,13 +1,13 @@ import org.gradle.api.JavaVersion.VERSION_11 plugins { - alias(libs.plugins.android.application) + id("com.android.application") kotlin("android") kotlin("kapt") - alias(libs.plugins.dagger) - alias(libs.plugins.ktlint) - alias(libs.plugins.license) - alias(libs.plugins.dexcount) + id("com.google.dagger.hilt.android") + id("org.jlleitschuh.gradle.ktlint") + id("com.jaredsburrows.license") + id("com.getkeepsafe.dexcount") } android { diff --git a/build.gradle.kts b/build.gradle.kts index c3b5fc4..c285761 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,6 +19,7 @@ plugins { alias(libs.plugins.ktlint) apply false alias(libs.plugins.license) apply false alias(libs.plugins.versions) + alias(libs.plugins.dexcount) apply false } allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..2e6e589 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 94b4cb4..e9ece99 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,6 +19,7 @@ dependencyResolutionManagement { plugins { id("com.gradle.enterprise") version "3.8.1" } +enableFeaturePreview("VERSION_CATALOGS") gradleEnterprise { buildScan { diff --git a/test-shared/build.gradle.kts b/test-shared/build.gradle.kts index 8115fa4..ff5e4e3 100644 --- a/test-shared/build.gradle.kts +++ b/test-shared/build.gradle.kts @@ -2,9 +2,9 @@ import org.gradle.api.JavaVersion.VERSION_11 import java.net.URL plugins { - alias(libs.plugins.android.library) + id("com.android.application") kotlin("android") - alias(libs.plugins.ktlint) + id("org.jlleitschuh.gradle.ktlint") } android { ```
jaredsburrows commented 2 years ago

Okay! Thanks. I was just about to respond to this thread. I am now curious if https://github.com/jaredsburrows/gradle-license-plugin handles this case as well.

jaredsburrows commented 2 years ago

I'll close this in favor of https://github.com/ben-manes/gradle-versions-plugin/issues/471.