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

Failed to determine the latest version for the following dependencies with Kotlin 2.0.0 #842

Open
ianbrandt opened this issue Feb 25, 2024 · 3 comments

Comments

@ianbrandt
Copy link

ianbrandt commented Feb 25, 2024

When I upgrade my project to Kotlin 2.0.0-Beta4, I get the following from dependencyUpdates:

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.google.devtools.ksp:symbol-processing-api
     1.9.22-1.0.17
 - com.squareup:kotlinpoet-ksp
     1.16.0
 - io.insert-koin:koin-test-junit5
     3.5.3
 - io.kotest:kotest-assertions-shared
     5.8.0
 - io.kotest:kotest-framework-api-jvm
     5.8.0
 - org.jetbrains.kotlin:kotlin-reflect
     1.9.22
 - org.jetbrains.kotlin:kotlin-stdlib
 - org.jetbrains.kotlinx:kotlin-deeplearning-api
     0.5.2
 - org.jetbrains.kotlinx:kotlin-deeplearning-tensorflow
     0.5.2

Plugin version 0.51.0. Reproduces with Gradle 8.6 and 8.7-rc1.

Reproducer: https://github.com/sdkotlin/sd-kotlin-talks/tree/2363d9a0686164707d1256837cd343df098e51e1

I don't get the errors with Kotlin 1.9.22: https://github.com/sdkotlin/sd-kotlin-talks/tree/a412bc0b6c80436a31dad58f51608c1cd70da170

Here is one of the --info details (the rest appear to be similar):

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.google.devtools.ksp:symbol-processing-api
     1.9.22-1.0.17
The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.google.devtools.ksp:symbol-processing-api:+.
Required by:
    project :ksp-builder-generator:processor
Caused by: org.gradle.internal.component.NoMatchingGraphVariantsException: No matching variant of com.google.devtools.ksp:symbol-processing-api:1.9.22-1.0.17 was found. The consumer was configured to find sources for use during runtime, compatible with any Java version, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
  - Variant 'apiElements' declares a component, compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
      - Incompatible because this component declares a library for use during compile-time and the consumer needed documentation for use during runtime
      - Other compatible attribute:
          - Doesn't say anything about the documentation type (required sources)
  - Variant 'runtimeElements' declares a component for use during runtime, compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
      - Incompatible because this component declares a library and the consumer needed documentation
      - Other compatible attribute:
          - Doesn't say anything about the documentation type (required sources)
	at org.gradle.internal.component.resolution.failure.describer.IncompatibleGraphVariantsFailureDescriber.describeFailure(IncompatibleGraphVariantsFailureDescriber.java:42)
	at org.gradle.internal.component.resolution.failure.describer.IncompatibleGraphVariantsFailureDescriber.describeFailure(IncompatibleGraphVariantsFailureDescriber.java:34)
	at org.gradle.internal.component.ResolutionFailureHandler.lambda$describeFailure$1(ResolutionFailureHandler.java:202)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.gradle.internal.component.ResolutionFailureHandler.describeFailure(ResolutionFailureHandler.java:202)
	at org.gradle.internal.component.ResolutionFailureHandler.describeFailure(ResolutionFailureHandler.java:195)
	at org.gradle.internal.component.ResolutionFailureHandler.noMatchingGraphVariantFailure(ResolutionFailureHandler.java:141)
	at org.gradle.internal.component.model.GraphVariantSelector.selectVariants(GraphVariantSelector.java:141)
	at org.gradle.internal.component.model.GraphVariantSelector.selectVariants(GraphVariantSelector.java:72)
	at org.gradle.internal.component.model.LocalComponentDependencyMetadata.selectVariants(LocalComponentDependencyMetadata.java:120)
	at org.gradle.internal.component.model.DelegatingDependencyMetadata.selectVariants(DelegatingDependencyMetadata.java:46)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:262)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:147)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:367)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:259)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:194)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:164)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphResolver.resolve(DependencyGraphResolver.java:121)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.doResolve(DefaultConfigurationResolver.java:373)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:265)
	at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:90)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:750)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:739)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphInBuildOperation(DefaultConfiguration.java:739)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusivelyIfRequired$6(DefaultConfiguration.java:731)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:505)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusivelyIfRequired(DefaultConfiguration.java:723)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveGraphIfRequired$5(DefaultConfiguration.java:713)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$fromMutableState$2(DefaultProjectStateRegistry.java:430)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:360)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:430)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:713)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$500(DefaultConfiguration.java:154)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ResolverResultsResolutionResultProvider.getValue(DefaultConfiguration.java:690)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:623)
	at org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
	at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.kt:56)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolve(DependencyUpdates.kt:89)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolveProjects(DependencyUpdates.kt:74)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.run(DependencyUpdates.kt:44)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask.dependencyUpdates(DependencyUpdatesTask.kt:138)
[...]
@ben-manes
Copy link
Owner

For some reason it wants the sourcesElements variant, but the authors decided not to publish that in their gradle module metadata. For example in my project's module metadata,

"name": "sourcesElements",
  "attributes": {
    "org.gradle.category": "documentation",
    "org.gradle.dependency.bundling": "external",
    "org.gradle.docstype": "sources",
    "org.gradle.usage": "java-runtime"
  },

For some reason the dependency did not include that in their module metadata.

I guess Kotlin multi-platform needs the sources and since those are not available in the metadata, it fails? They are included on the repository, though. This is more of a Gradle team question, as module metadata is confusing and the Kotlin tends to do odd things that are inconsistent with the ecosystem. I'm not the one capable of debugging this knot.

@ianbrandt
Copy link
Author

ianbrandt commented Apr 11, 2024

I retested with Gradle 8.7 and Kotlin 2.0.0-RC1. No significant change.

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.google.devtools.ksp:symbol-processing-api
     2.0.0-RC1-1.0.20
 - com.squareup:kotlinpoet-ksp
     1.16.0
 - io.kotest:kotest-assertions-shared
     5.8.1
 - org.jetbrains.kotlinx:kotlin-deeplearning-api
     0.5.2
 - org.jetbrains.kotlinx:kotlin-deeplearning-tensorflow
     0.5.2

@ben-manes, Do you have a Gradle contact you'd typically reach out to for the sort of help you mention above? I can reference this in the #eap channel of the Kotlin Slack (they are asking for 2.0.0 RC testing feedback there), but I'm wondering if this isn't more of a Gradle than Kotlin issue.

@ianbrandt ianbrandt changed the title Failed to determine the latest version for the following dependencies with Kotlin 2.0.0-Beta4 Failed to determine the latest version for the following dependencies with Kotlin 2.0.0 Apr 11, 2024
@ben-manes
Copy link
Owner

ben-manes commented Apr 11, 2024

I don't have one. I have simply been a nuisance for them since early years so interacted with many on their team. If one of their devs feels generous then they'll step in and help.

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